Moving and changing existing installations

    Note that if you are planning both a move of your installation and an update to a new version you should separate these steps. When you upgrade, setup will migrate your database to be consistent with the current version of Zenphoto. If you do some thing like restoring your database to what existed for a previous version of Zenphoto you have potentially compromised everything in your installation.

    So, bottom line, if you use MySQL to backup and restore your database, be sure you do so with the same version of Zenphoto running. Zenphoto does provide a backup/restore facility that is able to deal with many of the migration issues. But it is still recommended that you do your restore on the same version of Zenphoto that created the backup because you will not know if it can handle the migration until the restore.

    Moving on the same server

    1. Login with full admin rights
    2. Unprotect the setup scripts.
    3.  There three ways to move on the same server basically:
      1. Physical move to another location: If you installed Zenphoto in a subfolder named for example Zenphoto (e.g. https://yourdomain/zenphoto/) and just want to move it to the root or another folder, just move the complete content (all files and folders) of the folder to the new location.
      2. Renaming the folder Zenphoto is installed in: If you did not install Zenphoto in the root of your webspace but in a separate folder (e.g. https://yourdomain/zenphoto/) just rename it. 
      3. Domain change: If you installed Zenphoto in a subfolder and would like it to be the root of your domain or subdomain you can also just link the domain to that folder and it will be the "root. The same way you can also link a new domain to your install.
    4. Now run setup (zp-core/setup.php). This will correct the rewritebase (webpath) in your .htaccess file to the new location. You can also do this manually within the file. If installed in the root of your domain the rewriteBase is empty, otherwise contains the folder name.
    5. Now access your site/admin backend and everything should be as usual.

    Moving to a new server

    1. Copy the root index.php and the zp-core folder to the new server. Make sure it is the same release version as the old install. Do not run setup yet.
    2. Copy all customized themes or plugins from the old to the new location.
    3. Export the database of the old install using the database backup tool on the admin overview page. (if you are still on a very old version, use tools like phpMyAdmin for this)
    4. Copy the following folders from the old to the new location:
      • backup folder
      • albums folder
      • cache folder
      • uploaded folder (optional if you used it)
    5. Now run setup (/zp-core/setup.php). It will provide the option to import that database backup - it is ciritcal that the albums folder is already present when you have to set your user/password details.
    6. Now access your site/admin backend and everything should be as usual. 

    Wrong URLs after moving

    If you first installed Zenphoto within www.yourdomain.com/zenphoto and later decide to move it directly into the root www.yourdomain.com you need to run setup (/zp-core/setup.php) again. This will correct the rewrite base within the .htaccess file.

    You need to do the same if you want to keep Zenphoto within a subfolder but would like to rename it to /gallery for example.

    Creative Commons LicenseThis text by www.zenphoto.org is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

    Code examples are released under the GPL v2 or later license

    For questions and comments please use the forum or discuss on the social networks.

    Related items