Saving and restoring maps from the database