Backup and Restore
Prev | Chapter 2. Gallery 1.x Administration Guide | Next

## Backup and Restore

There are three ways to backup your Gallery. They are both described here.

### Warning

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

### Using 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!

### Using 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 recieve errors.

### Using the backup script (1.3.4 and above)

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.

### Note

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.

- If you move your data files between Windows and Unix, your user database will not work properly. You'll have to manually rebuild your user database. Hopefully this will be fixed in a future Gallery version.

Prev | Up | Next
Securing Gallery | Home | Creating an Offline Copy