Forum
How to install Perch locally
Hi,
I have an existing website live that uses Perch.
I want to create a local 'development' version of this.
I have downloaded mySQL and created a new database in phpMyAdmin for the website but not really sure where to go from there.
Currently using WAMP to access the .php pages via localhost which is good for making page template changes but I want to be able to make changes in the Perch CMS and have that change only be reflected locally.
Can someone explain step-by-step how I might do this?
Also I don't want to lose any of the data currently in the live cms. I want to start with a carbon copy of the live website if that makes sense.
Thanks
So are you wanting to make a copy of your live site? You'll need to download the database as an
.sql
file and import it into your local MySQL.The process is the same as moving a site from local to live, just the two servers are swapped. https://docs.grabaperch.com/perch/building/servers/how-do-i-move-a-perch-site/
That's exactly what I want yes, a copy of the live site.
How do I export the database as an .sql file if the current live site is not set up in WAMP? That's the bit I'm struggling with because i need to import that into my new database on phpMyAdmin.
any ideas?
Whichever tool you use to manage your website on the live server should have an export option to enable you to make backups of your database.
Hi Chris
You need to connect to your host's database and export it as an sql file. Exactly like you would do locally.
You can do this many ways - it depends on your host. Most hosts also use phpMyAdmin which you'll find normally in your hosting control panel. Or you can use a desktop app, something like Navicat, to connect remotely and sync it to your local environment that way – that's what I do. You'll probably need to enable remote connections in this case on your hosting.
You'll find oodles of stuff written about this out on the internet - it's kind of beyond the scope of Perch support.
Best of luck
Jon
OK, so I host with GoDaddy, so if I backup the database from the Plesk admin and import that into myPhpAdmin that should do the trick?
At the moment when i go to localhost/perch all I see is a long page of content that is currently in the live perch cms.
That would be an important step forwards, yes.
That doesn't sound good.
/perch
should be your control panelBrilliant,
I have now imported the live database into my new 'development' one in phpMyAdmin but am getting this error...
Table structure for table
perch2_categories
CREATE TABLE
perch2_categories
(catID
int(10) NOT NULL,setID
int(10) UNSIGNED NOT NULL,catParentID
int(10) UNSIGNED NOT NULL DEFAULT '0',catTitle
char(64) NOT NULL DEFAULT '',catSlug
char(64) NOT NULL DEFAULT '',catPath
char(255) NOT NULL DEFAULT '',catDisplayPath
char(255) NOT NULL DEFAULT '',catOrder
int(10) UNSIGNED NOT NULL DEFAULT '0',catTreePosition
char(255) NOT NULL DEFAULT '000',catDynamicFields
text NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 MySQL said: Documentation1050 - Table 'perch2_categories' already exists
However /perch now takes me to a login screen
When and where do you get that error?
in phpmyadmin on localhost when I import the live database .sql into my new development database.
I get it when I click 'OK' to import the .sql file. The page address is... https://localhost/phpmyadmin/import.php
Is the development database empty first?
Yes, I set up a completely empty database yesterday
OK, so I just deleted the database, created a new one and imported the .sql again and that has cleared the error.
Which details do i need to use to now login to the local version?
I have 'localhost' down as the development domain in my Perch account
I logged in with the same details as I would on the live server and all appears to be configured and working correctly!
Thank you for all your help, much appreciated.
I may even write a blog post on my website on how to do this for anyone in a similar situation to mine.