I’ve only once had to restore a PHPBB site from backup because of a failure (thanks to a blunder by URPad) but have done it a few other times when migrating between systems. If you take anything from this post it should be the importance of regular off-site backups, even if your data is hosted in a so called ‘secure’ data center.

Restoring the actual files is simple. Just copy the files to the new location and set the correct permissions.

In some cases the MYSQL database restore required slight modifications before the restore was successful. As you will see below in this case it was due to the size of the ‘sessions’ table which should probably be purged from time to time.

  1. Migrating the DB from one MYSQL installation to another via the built in backup/restore utility in PHPBB did not work (Invalid data error on restore error)
  2. Restoring via phpmyadmin required modifying the Maximum File Size that can be imported in php.ini, the default is only 2MB. Max is 8MB but can upload a zipped file.
  3. Once the maximum file size was modified, restoring via phpmyadmin still failed but didn’t come up with an error.
  4. After this tried restoring using the ‘mysql…’ command which seemed to time out, always on the same line. Increasing the memory and time-out limits did not fix the problem.
  5. Once I commented out all the insert statements for the one problem table (sessions) and ran the command again the upload worked fine.

MYSQL Import Command

mysql -u username -p -h server_name database_name < data.sql

MYSQL View Time-Out Values

mysql> show variables like '%timeout';

All the MYSQL system settings (timeouts, memory…) can be changed in the /etc/mysql/my.ini file. Need to restart mysql for the changes to apply.