Skip to content

Instantly share code, notes, and snippets.

@shivapoudel
Last active December 12, 2023 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shivapoudel/6e9c557f7f9da0aab0354a8afd821918 to your computer and use it in GitHub Desktop.
Save shivapoudel/6e9c557f7f9da0aab0354a8afd821918 to your computer and use it in GitHub Desktop.
How can I restore a site from a Local site folder?

In case you are just needing to restore a Local site from an existing Local site folder, here’s how:

Note: There must be SQL files present in app/sql in order for this to work. Otherwise, the database won’t be able to be restored.

  1. Rename htdocs with htdocs-backup.
  2. Create new sites for each using existing domains and paths. Now go to Open Site SSH and browse the directory.
D:
cd ..
  1. Run this commands:
mysql -u root -proot -e "DROP DATABASE local;"
mysql -u root -proot -e "CREATE DATABASE local;"
mysql -u root -proot local < D:\htdocs\<sitename>\app\sql\local.sql

OR

mysql -u root -proot local < C:\Users\shiva\OneDrive\Local\<sitename>.sql

OR

mysql -u root -proot --max_allowed_packet=64M local < E:\shop-eachperson\sql\<environment>\eachperson.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment