lokl-cli icon indicating copy to clipboard operation
lokl-cli copied to clipboard

restore a backup

Open yoannsark opened this issue 4 years ago • 6 comments

This backup feature is really useful, what do you think about a restore feature ? I can try to add it if you find it relevant.

yoannsark avatar Jan 14 '21 20:01 yoannsark

Definitely! I have a need for it currently, to help debug a user's site. They sent the files using that backup technique.

My thoughts on the importer, but free to suggest any way you like:

  • option in wizard on site sub-menu to import site from backup
  • accepts 1 file (tar.gz, zip or dir) for site files and one file (tar/zip/sql) for the DB
  • discovers (by parsing the SQL file) the existing site's URL
  • (maybe need to adjust the sql file if it contains drop/create cmd for DB with name other than wordpress which Lokl uses?)
  • prompt user to take backup before importing into existing site
  • replace site files with the new site files data
  • drop and create wordpress db
  • import mysql
  • (optionally) set the admin user/pass to Lokl default of admin/admin

leonstafford avatar Jan 14 '21 22:01 leonstafford

for testing, can run sh test.sh, which is shellcheck and shellspec. shellcheck should be common to install via your package manager. shellspec installation idea can be taken from the circleCI config

leonstafford avatar Jan 14 '21 22:01 leonstafford

by accepting 2 files (or maybe accept 1, which contains an .sql file in root of site files), we can accept importing imports from any standard WP export, not just rely on Lokl's exported filename structure

leonstafford avatar Jan 14 '21 22:01 leonstafford

Sorry for the delay ! I've been quite busy lately.

Yes I think that the process you suggest is perfect. Do you think this feature should be accessible directly from the main menu or after creating a new site ?

Thank you, I managed to run the tests, I will try to understand the script and add that.

yoannsark avatar Feb 15 '21 21:02 yoannsark

Not sure how useful this is, but I've been using All-in-One Migration to copy between live and lokl WP sites.

sameoldlab avatar Apr 15 '21 23:04 sameoldlab

Thanks, @ibrooooo! Sorry, have seen you've commented on the forum, but I haven't had a chance to check/reply yet.

leonstafford avatar Apr 18 '21 12:04 leonstafford