Forum
How to restore Perch database from backup
We have an old Perch install v2.2.4 that I need to update to the latest version. (for our site www.esis.com.au ) Before doing that I want to test it out on my development PC. So I'm first trying to replicate the existing site onto my development PC.
However my PC has been rebuilt so I have had to reinstall everything. I downloaded the entire perch folder from my website to the PC. I have taken a "database only" backup from Perch on the live site.
I've set up EasyPHP on the PC (which works for hosting the non-perch pages) and configured a database called "perchtest" (same as was originally on my old devel PC), and setup username and password. I ran the perch database test and it tests out OK. I have opened the perch installation page and it said it has installed successfully. I now have a working, empty Perch system with no pages, on my devel PC.
Now I want to restore the database backup. However there are no instructions on your website for how to do this. I've wasted hours searching through the documentation and forums but can't find any simple instructions for how to restore the perch database from a backup.
So I tried using phpmyadmin, clicked on Import, selected the backup file (after renaming it to end with .sql.php). It failed saying there was no database to connect to. So I opened the "perchtest" database, and clicked on Import from there. Now it fails with the following message:
Error
SQL query: Edit
SELECT `comment`
FROM `phpmyadmin`.`pma__column_info`
WHERE db_name = 'perchtest'
AND table_name = ''
AND column_name = '(db_comment)'
MySQL said:
#1100 - Table 'pma__column_info' was not locked with LOCK TABLES
I'm tearing my hair out trying to get this working. I have a business to run, I don't have time to mess around with this. It should just work!!
One thing that comes to mind - is it necessary for the database to have the same name locally as it has on the live website, for the backup to work? Mine is different. (If so, what's the easiest way for me to change Perch to use a new database name?)
Diagnostics report
PERCH INFORMATION
Perch: 2.2.4
Production mode: Production (100)
Installed apps: content (2.2.4), perch_backup (1.2)
DB driver: PDO
DB tables: perch2_content_index, perch2_content_items, perch2_content_regions, perch2_content_resources, perch2_navigation, perch2_navigation_pages, perch2_page_templates, perch2_pages, perch2_resources, perch2_settings, perch2_user_privileges, perch2_user_role_privileges, perch2_user_roles, perch2_users
Users: 1
App runtimes:
<?php
include(PERCH_PATH.'/core/apps/content/runtime.php');
?>
Editor plug-ins: ckeditor, ckeditor.old, markitup
H1: 421aa90e079fa326b6494f812ad13e79
L1: c18b217062f65fdb614fcba8d984ce05
headerColour: #ffffff
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 0
content_collapseList: 1
lang: en-gb
latest_version: 2.8.8
update_2.2.4: done
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: perch
PERCH_DB_SERVER: localhost
PERCH_DB_DATABASE: perchtest
PERCH_DB_PREFIX: perch2_
PERCH_EMAIL_FROM: <I removed this from the report to prevent spam>
PERCH_EMAIL_FROM_NAME: Chris Dobbie
PERCH_LOGINPATH: /perch
PERCH_PATH: C:\www\perch
PERCH_CORE: C:\www\perch\core
PERCH_RESFILEPATH: C:\www\perch\resources
PERCH_RESPATH: /perch/resources
PERCH_HTML5: 1
PERCH_ERROR_MODE: DIE
PERCH_DEBUG:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: C:\www\perch\templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_RWD:
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
HOSTING SETTINGS
PHP: 5.5.8
Zend: 2.5.0
OS: WINNT
SAPI: apache2handler
Safe mode: not detected
MySQL client: mysqlnd 5.0.11-dev - 20120503 - $Id: 1514feb3700aa52d513182fcdc87f2c66f06d152 $
MySQL server: 5.6.15-log
Extensions: Core, bcmath, calendar, ctype, date, ereg, filter, ftp, hash, iconv, json, mcrypt, SPL, odbc, pcre, Reflection, session, standard, mysqlnd, tokenizer, zip, zlib, libxml, dom, PDO, bz2, SimpleXML, wddx, xml, xmlreader, xmlwriter, apache2handler, Phar, curl, gd, mbstring, mysql, mysqli, pdo_mysql, pdo_sqlite, sockets, sqlite3, xsl, mhash, xdebug
GD: Yes
ImageMagick: No
PHP max upload size: 20M
PHP max form post size: 20M
PHP memory limit: 1024M
Total max uploadable file size: 20M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
TMP: C:/PROGRA~2/EASYPH~1.1VC/binaries/tmp
HTTP_HOST: localhost
HTTP_CONNECTION: keep-alive
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_UPGRADE_INSECURE_REQUESTS: 1
HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.125 Safari/537.36
HTTP_REFERER: https://localhost/perch/core/settings/
HTTP_ACCEPT_ENCODING: gzip, deflate, sdch
HTTP_ACCEPT_LANGUAGE: en-GB,en-US;q=0.8,en;q=0.6
HTTP_COOKIE: PHPSESSID=tutm88nl4rl1mrh3fomvog6ct3
PATH: C:\Program Files (x86)\EasyPHP-DevServer-14.1VC11\binaries\php\php_runningversion;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\WinMerge;;C:\PROGRA~2\EASYPH~1.1VC\Apache\bin;C:\PROGRA~2\EASYPH~1.1VC\PHP
SystemRoot: C:\Windows
COMSPEC: C:\Windows\system32\cmd.exe
PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
WINDIR: C:\Windows
SERVER_SOFTWARE: Apache/2.4.7 (Win32) PHP/5.5.8
SERVER_NAME: localhost
SERVER_ADDR: 127.0.0.1
SERVER_PORT: 80
REMOTE_ADDR: 127.0.0.1
DOCUMENT_ROOT: C:/www
REQUEST_SCHEME: http
CONTEXT_DOCUMENT_ROOT: C:/www
SERVER_ADMIN: admin@127.0.0.1
SCRIPT_FILENAME: C:/www/perch/core/settings/diagnostics/index.php
REMOTE_PORT: 64672
GATEWAY_INTERFACE: CGI/1.1
SERVER_PROTOCOL: HTTP/1.1
REQUEST_METHOD: GET
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
PHP_SELF: /perch/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1438748772.184
REQUEST_TIME: 1438748772
You are running version 2.2.4 - a newer version is available.
Perch by edgeofmyseat.com
The issue you are having doesn't appear to have anything to do with Perch? It sounds like you are having issues importing an SQL file using the tool you are using locally. It may be you need to contact "EasyPHP" support.
For reference the documentation on moving a Perch site can be found here: https://solutions.grabaperch.com/development/how-do-i-move-a-perch-site
Thanks Rachel for such a quick response! That doco for moving a Perch site is exactly what I needed, now I've got it working on my development PC.
However there is still one unanswered question: Where is the documentation for how to restore a Perch site from the backup that the Perch Backup app saves?
The Perch backup app just creates an SQL dump. So exactly the same as moving a site in any other way, it doesn't do anything special.