Making a test server's data identical to production server

Hi guys,


I already installed a test matrix server using matrix 3.16.6 which is the same version as our production server. I can login to matrix test server but of course without any data information. Can you please guide me through in restoring the backup file from the production server to the test server? I might mess up my test server if doing a restore coz i do know it needs more configuration to make it run.



Thanks

Joseph

[quote]Hi guys,


I already installed a test matrix server using matrix 3.16.6 which is the same version as our production server. I can login to matrix test server but of course without any data information. Can you please guide me through in restoring the backup file from the production server to the test server? I might mess up my test server if doing a restore coz i do know it needs more configuration to make it run.



Thanks

Joseph[/quote]

The best way would be to use an entire copy of the production system. This is due to the data on the filesystem and database already being related to the source system (eg; asset IDs from System A aren’t guaranteed to line up on System B ).



We have a Backup Management Guide which describes the backup and restore procedure for a Matrix system. Please note that after restoring the production system as a test environment that the system URLs and database configuration will need to be changed to point to the test environment. These configuration files are stored in the data/private/conf directory. Details on the configuration of these files is available in our Backup Management Guide.

quick question on having postgres on a different server - is there anyway to manipulate the backup.sh script so the db user/pass is automatically sent? i want to put the backup.sh in my crontab but the script requires a human to enter the user/pass of the matrix db.


Since the pg_dump command doesn't support passing a password at the command line, you have two options:
[list=1]
  • Modify the user/role to remove the password (so a prompt isn't required)
    [*]Create an expect script that automatically provides the password to pg_dump in a backup wrapper script.

    If the servers hosting Matrix are not shared, then the first option is usually the easiest (you can restrict who accesses the database in your pg_hba.conf instead). Otherwise, if you want an example expect script, it'd be something like what is found expect.

    Hope this helps. :)

    Dan.

  • There's actually a third, not-so-well-known option.
    http://www.postgresql.org/docs/8.1/interactive/libpq-pgpass.html

    Obviously, storing passwords on-disk is a no-no when it comes to security, but if you are after flexibility and don't mind compromising a little bit, then that would be your "best" option.

    Depending on how many people you got doing matrix admin/dev, why not just edit your local hosts file and point it to test server when you need it - then its a matter of just syncing everything except the db file? (and remember to take it out of your local hosts file afterwards :) )