Gallery1:Backup and Restore - Gallery Codex
Personal tools

Gallery1:Backup and Restore

From Gallery Codex

There are three ways to backup your Gallery. They are each described below.

Warning

There are some caveats to backing up your albums! Please read the caveats section for more information.

Tar

Backup

Backup using tar is relatively simple, but you must have shell access. Run the following command in the parent directory of your albums directory:

tar -czvf albums.tar.gz albums   

This will give you a file, albums.tar.gz which contains your albums directory.

Restore

Restoring the albums directory using tar is also easy. Run this command in the parent directory of your albums directory (or where you want your albums directory to be)

tar -xvzf albums.tar.gz
chmod -R 777 albums   

The second command is as important as the first!

FTP

Backup

Basically, to backup your albums using FTP, just download the whole albums directory. This will give you an exact copy of the directory on your local computer, which you can hold on to in case it's needed

Restore

To restore your albums directory using FTP, just re-upload the albums directory that you downloaded to your computer. The only problem is that the new files must be chmodded 0777 recursively. Recursively means every file and every directory. This can be a pain using FTP, but is necessary or you will receive errors.


Backup script (1.3.4 and above)

Backup

Gallery 1.3.4 is equipped with a new backup_albums.php script to backup your albums. It's located in your setup/ directory. To use it, you must copy it out of the setup/ directory and put it in your base gallery directory.

Then navigate to it using your browser, when logged in as an admin. For example, http://www.example.com/gallery/backup_albums.php. From there you will have a number of options.

Warning

Using the "All Files" option will more than likely give a HUGE file, and may take a while. We recommend just backing up the data files.

Windows Users -- It is recommended that you just use WinZip or FTP to backup your files because most Windows servers don't have any of the utilities that the backup script needs.

Caveats

When backing up on one platform and trying to restore on another platform, i.e. transmogrify from Windows to UNIX, you will need to eliminate all occuring "\r" (LF) in all the .dat files. Double-Breaks like "\r\n" will have to change to "\n". Utilities like dos2unix and can help in this realm.