How to maintain a local mirror image of your gallery2 setup for development
AMTuring
Joined: 2009-11-05
Posts: 1 |
Posted: Thu, 2009-11-05 16:48 |
I may be mistaken, but I was unable to find a solution in the FAQ or forums. I want to maintain a local copy of the Gallery2 setup (photos and database) to work on my website design without disturbing the working website. The instructions for backup were helpful, but the backup installed on my local machine did not work. I am running Max OS X and MAMP (Mac Apache, MySQL and PHP) for a local web server. I found the key points were to A similar procedure could also be used to move from one webhost to another. Here is a step-by-step description of how I got it working: 1. Perform a backup of your database as per the instructions at http://codex.gallery2.org/Gallery2:How_do_I_Make_Backups_of_My_Database. You will bet a sql file backup of your databse from this procedure. Copy this to your local machine. $gallery->setConfig('data.gallery.base', '/homepages/14/d9999999999/htdocs/gallery2/g2data/'); and I changed it to $gallery->setConfig('data.gallery.base', 'g2data/'); The path is relative to the gallery2 directory if your data is in a different location. You may also need to change the server name. My webhost provides MySQL databases on a separate server, so the hostname had to point away from the local machine. On my website the server was as follows: $storeConfig['hostname'] = 'db9999.perfora.net'; I changed this to the following. $storeConfig['hostname'] = 'localhost'; Also note that an alternative to creating a user in step 2 is to edit the database user information you will find near the above line in the config.php. You can change the config to match your local default user (e.g. root). Finally, to keep the mirror up to date repeat the steps, but now use rsync to copy over only the updated gallery2 data. In fact I use rsync to make a copy of the entire website. I hope someone else finds this useful. I can freely play with the website design with full gallery2 functionality on my local machine now.
AMTuring |
|