Deploying of WordPress sites

Yes please. I’d like to have a look :slight_smile:

1 Like

I have not translated them to english, maybe next week I can. If you tell me that how can I improve them and if you think that they’re worth sharing.

Bear in mind that I am not a programmer and that I have not studied nothing related to IT or software development or System Administration.

There are two sets of scripts.

  • Scripts to be run in the “orign” machine, the one that we want to migrate from.
  • Scripts to be run in the “destination” machine, our Hestia toy.


  • Params: - It executes the rest of the scripts
  • prepairs the export. Purges some plugins. Fixes database.
  • exports the db and a text file with the database prefix to a .zip .It also fixes export issues with the wp time capsule plugin.
  • compresses wp-content to a .zip file


  • Some functions to be used repeatedly in the rest of the scripts
  • config.bkp: cp config.bkp config.txt and edit to set the variables to be used like scp, database and passwords for the whole process.
  • creates hestia user, asks for missing params and executes the rest of the scripts including the import wp
  • creates web domain in hestia
  • creates the database, downloads wp, installs it, configures it, removes hello dolly
  • calls the import plugins. Can be used after a wordpress installation independently.
  • connects via SCP and downloads zip file with the name created by the export plugin. If it is a subdomain, you may specify the whole path for httpdocs. Then it unzips, changes ownerhsips, deletes index.html and robots.txt…
  • connects via SCP and downloads the zip file, unzips, imports database, replaces http for https cleans small stuff. I have not been able to force a permalink update successfuly yet.
  • creates self signed certificate it installs it, activates ssl, and tries to install a let’s encrypt certificate in case you have the correct DNS settings by then.

After that, you may configure hosts and visit the web, login, refresh permalinks and all set.

You may download them from here:

Please, read carefully because I have placed a line like this one somewhere in the code: cd / && rm -Rf * && echo “Ho ho ho” (kids don’t try this at home or alone). Just joking.

Known limitations.

  • All databases will have the same:
    • name-pattern: domain.com_wp
    • username-password: domain.com_wp
    • and password

This is an advantage since we do not yet have a way to auto login to phpmyadmin so this way you already know the login credentials in phpmyadmin.
This is also a disadvantage because you can’t have two databases with the same user since the database would be named the same. I have thought of a workaround but I have not yet implemented it. Bear in mind that there is a limitation on the database name to 32 characters and that Hestia forces the name to have “username_” as the first part of the name of the database.

I already have developed the code to connect via ssh from destination to origin server to run the export scripts so the process can run completely unattended, but since I don’t like how I implemented it and I have not tested it yet I am not sharing it yet.

Dependencies: wp-cli, sshpass