Importing a site created on Pantheon

Hi,

I have created a site using pantheon for the first time, it gives me the option of using git to clone the site down to local so I can make some changes.

Will this work with local and if so has anyone got experience with this?

I was simply going to clone the site into /Local Sites/ dir but wanted to check first.

Thanks Craig

1 Like

Hi Craig,

Local doesn’t automatically map the folders in Local Sites to the sites in Local. In other words, you’ll need to create a site in Local prior to cloning it with Git.

I’m unfamiliar with how Pantheon handles Git, but here are two potential ways you can go about this.


Option A (Manual): Create a brand new site in Local and clone

  1. Create a new site in Local with the desired name and local site domain
  2. Copy the site’s app/public/wp-config.php file somewhere safe like your Desktop
  3. Delete the site’s app/public folder
  4. Clone the git repository (assuming the repository includes all WordPress core files) into app/public
  5. Copy the wp-config.php file that you backed up back into app/public
  6. Go to the site in Local then navigate to Database » Adminer
  7. Select all tables and drop them
  8. Download the appropriate SQL backup from your host
  9. Go back to Adminer and import the SQL file
  10. Right-click on the site in Local
  11. Go to ‘Open Site SSH’
  12. Enter wp search-replace '//olddomain.com' '//newdomain.com' (olddomain.com being your live domain and newdomain.com being your Local site domain)
  13. Test the site

Option B: Import the site from a backup and then clone the repository

  1. Download a recent backup from your host that contains all WordPress core files as well as a database dump. The backup must contain at least the wp-content folder and an SQL file.
  2. Drag and drop the backup onto Local’s main window or Dock icon to kick off an import
  3. Follow the import process and verify that the site is working locally
  4. Copy the site’s app/public/wp-config.php file somewhere safe like your Desktop
  5. Delete the site’s app/public folder
  6. Clone the git repository (assuming the repository includes all WordPress core files) into app/public
  7. Copy the wp-config.php file that you backed up back into app/public
  8. Test the site
1 Like