lokl-cli
lokl-cli copied to clipboard
restore a backup
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.
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
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
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
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.
Not sure how useful this is, but I've been using All-in-One Migration to copy between live and lokl WP sites.
Thanks, @ibrooooo! Sorry, have seen you've commented on the forum, but I haven't had a chance to check/reply yet.