Sunday, July 6, 2014

how to migrate piwigo from one server to another server

A lot of places were giving half info or conflicting info .

1st go to your old servers cpanel and then goto phpMyadmin
click on your old database on the left
then goto export and export the whole db

then you need to download via ftp these 5 folders

  • galleries
  • upload
  • plugins
  • template-extension
  • local

upload will be the biggest folder as it contains all your uploaded photos.

now set up a new db on your new server via mysql
if your new server is on shared hosting. you need to edit the db name ,db user , pwd in the file inside the local folder

and then upload and unpack the piwigo zip file.
now delete the local folder .

upload the folders

  • galleries
  • upload
  • plugins
  • template-extension
  • local
via ftp to your new server 

without the upload folder from your old server your photos will not show up on your new server. 


  1. Followed all the steps. Cant access the admin pages, redirect to main gallery page. The main gallery page gives out the following errors.

    Warning: include(/ failed to open stream: No such file or directory in /home/photoandcrochet/public_html/piwigo/include/template.class.php on line 1156

    Warning: include(): Failed opening '/' for inclusion (include_path='.:/usr/share/php') in /home/photoandcrochet/public_html/piwigo/include/template.class.php on line 1156

    Fatal error? Uncaught --> Smarty: Unable to load template file 'menubar.tpl' <-- thrown in /home/photoandcrochet/public_html/piwigo/include/smarty/libs/sysplugins/smarty_internal_template.php on line 139

  2. Thanks for these instructions. I followed them and also encountered the error noted immediately above. I found that my old installations was referencing theme add-ons that weren't part of the default installation. After copying the extra themes found in the themes folder I the encountered a mysql error. After reviewing the stack trace I determined that my MySQL installation (Server version: 8.0.11 MySQL Community Server - GPL) was having issues with the sql statement returning columns not being prefixed with the table aliases. I determined that the flawed SQL was within include/ I made the following alterations to the query, saved the file and piwigo was then working as an exact clone of my old server.

    // $user['forbidden_categories'] including with USER_CACHE_CATEGORIES_TABLE
    $query = '
    ON = ucc.cat_id
    AND ucc.user_id = '.$user['id'];

    if ('recent_cats' == $page['section'])
    $query.= '
    WHERE '.get_recent_photos_sql('date_last');
    $query.= '
    WHERE c.id_uppercat '.(!isset($page['category']) ? 'is NULL' : '= '.$page['category']['id']);

    $query.= '
    array('visible_categories' => 'id'),

    if ('recent_cats' != $page['section'])
    $query.= 'order by c.rank';
    #ORDER BY rank';

    I did a lot of searching and this was the only post that I found about moving an existing installation to a new server so I hope that anyone else stumbling upon this will find these additional comments helpful.