How Do I Get Access to the Database?
Can I use PhpMyAdmin to modify my database?
Our systems doesn't allow the use of PhpMyAdmin due to security reasons, but you can use Adminer instead. Adminer offers the same functionalities as PhpMyAdmin, but does so with more security and ease of use. Adminer can be found from https://<own-website>/.seravo/adminer
. The credentials needed to login into the database are found from environment variables.
Command line (terminal) can be utilized to get into the database directly with the command wp db cli
. This action contains automatic authentication, so there is no need to type credentials manually. To use this, you need a valid SSH-sessions to your WordPress-environment. Instructions on how to connect with SSH can be found here.
Where can I find the WordPress environment variables?
If you take a look at the WordPress' wp-config.php -file ( /data/wordpress/htdocs/
) you can find numerous getenv()
calls instead of normal database information. Due to data security and scalability reasons, the information is being read from environment variables instead of fixed values. Wp-config.php -file fetches information about .env variables during execution.
You can find all the relevant environment variables, including database credentials by connecting with SSH and running the command wp-list-env
How do I create a database dump?
The database dump can be obtained in several ways. One option is to use the above mentioned Adminer-tool from a browser and download the database dump from there. First select the "export" button from top left corner:
After this view it is possible to dump the database with specific tables by choosing the "export" again:
After this a new tab opens, which contains the database with the selection of tables of your choosing (If 'Output' is set to 'open'). This database can be copied to an empty file and the suffix set to .sql
. Alternatively you can save the database directly as .sql
-file by choosing the 'save' option from 'Output' -field.
Another option is to log in to the server with SSH and run the command wp db export
, which automatically creates a SQL file of the WordPress databases. The standard mysqldump command also works.
The third option is to locate the content of the /data/db/
with SFTP, where you will find a database dump in the format of a SQL file, which is automatically created every night.