Prod/Test Environments

I am setting up a two environment systems, a production server and a test/dev server where we can have a copy of the production data. I tried dumping the database, and tar up the media folder, copy over to the test server, and then untar the media folder and clear the database and load the database file. That seems to work, but there are strange errors when uploading and such. Is there a better way to get a copy of your production data over to a test server? I guess I could just clone the virtual server, but thought maybe there would be a better way.

Hi. Did you check the correct permissions of Mayan’s document folder? Maybe the upload crashes because mayan cannot access its document storage?

# Permissions of the storage folder
mayan:mayan
rwxr-xr-x

# Permission of the files inside:
rw-r--r--

That’s sound about right (that is actually the best way to do a full backup). Besides the permissions check mentioned by @twp, check the settings specially the credentials. Could be a communication issue with RabbitMQ or Redis.

The files are correctly masked, and users/pass are good, they match the config file in Mayan. Are there user/passwords stored in the database of Mayan for Rabbit/Redis that I could be missing?

Also is there a debug mode I can put the test/dev server in for better debugging? The idea was if we had an issue with the prod server we move copy of the files/database to the test server and reproduce the error etc.

Are there user/passwords stored in the database of Mayan for Rabbit/Redis that I could be missing?

No, credentials for bootstrap services are not stored in the database.

Remove the config.yml and config_backup.yml, try passing the credentials as environment variables those have the highest priority and override any other method that could be left over or cached somewhere.

Also is there a debug mode I can put the test/dev server in for better debugging?

Putting Mayan on debug mode is not a good idea because it disables several things including background task processing. The best alternative are:

  • to set the logging level to DEBUG by setting the environment variable MAYAN_LOGGING_LEVEL=DEBUG
  • install Sentry to do live error logging. This is the best option when you start using Mayan for more serious things and have multiple environments.
1 Like