Blog Backup and Restore with Duplicator

I want sometimes to migrate the whole site to a test machine. A easy backup solution is also needed, not only for the content of the site (already built in for blog content) but also all installed plugins, settings and so on, also needed for simple disaster recovery.

Ok, I don’t want backup this is only time and resource consuming, but  I want restore. So I looked around an played a little bit with Duplicator  to test the restore function so I can trust this solution when I urgently want it.

  • [OK] get the plugin at productive platform and activate,
  • [OK] get the plugin at test platform and activate
  • [OK] Test it:
    • [OK] Build archive from live blog, don’t change anny settings, use everything right out of the box
    • [NOK] Download. The single download only get the install.php, but not the $archive.zip,
      but this is not a showstopper.
    • [NOK] mhm, existing installation overwrite only with pro Version, so they need empty on, but lets try something:
      • the packet archive is /var/www/$blogname/wp-snapshots
        $blogname := “wordpress” or in my case “blog”
      • ftp the archive.zip to this location
        Note to me: For convenience, if this works: Set a link from ../wp-snapshots to the ftp folders (/mnt/dietpi_userdata/downloads)
      • Go to blog test installation -> mhm, doesnt word, the package did not show up.
      • Copy all filese from the package (starting with the backup date…) to the test system.
      • nope, will also not work (even after restart the blog via raspi-reboot)
      • undo all copy, try next step.
    • [OK] ok so do the way they told: copy install.php and the $archive.zip to an emptyp folder
      • Rename the folder from test system to ./blog-old
      • Create folder ./blog and chown to “www-data”
      • ftp/copy the install.php and the $archive.zip
      • chown to www-data (will be at dietpi after copy…), 0100755…
      • [OK] at browser, go to testinstallation: https://…./install.php and start
      • [OK] valdiation chek -> pass
        • some entrys:
          Database name = wordpress
          User Name = wordpress
          Password = ****
          Database Host = localhost
        • [OK] test database:
          Host=localhost; Database=wordpress; Uid=wordpress; Pwd=*****; Port=3306)
        • [OK] run the process migration process
        • [OK] login and go to duplicator plugin and do the Installer file cleanup ran!
        • [OK] Clean Up:
          • Remove ./blog-old.
          • delete the $archive.zip from ./blog (and from temporary ftp folder)
          • check .htaccess, but due nothing in there I leave it as it is.
          • Reboot the whole raspi. Login again
  • [OK] Setup regular Backup to backup server in my preventive maintenance checklist (and do it now for first time after writing this post):
    • via Duplicator every 3 Month,
    • via Build in Export the *.xml file for posts and media: monthly.

Conclusion

At least, this plugin will do the basics I want: Restoring a backup as a disaster recovery. I have also to stay with the light version. Yes, restore from cloud or ftp would be very nice, but price tag for pro version is a bit hefty for this pure hobby project so I need also ssh/ftp into the local box.
This will be security issue during travel with no direct access from the local, secured network. Actual I did not allow ssh from outside local network, but are prepared with some safety measures like a working fail2ban setup for ssh.