Import WordPress database using Virtualmin

SYSTEM INFORMATION
Webmin version 1.984
Usermin version 1.834
Virtualmin version 6.17-3
Authentic theme version 19.84.7
Kernel and CPU Linux 4.19.0-17-cloud-amd64 on x86_64
CPU Intel Core Processor (Haswell, no TSX), 1 cores
Real memory 942.69 MiB used / 906.64 MiB cached / 1.9 GiB total
Virtual memory 1023.99 MiB used / 1023.99 MiB total
Local disk space 16.26 GiB used / 3.39 GiB free / 19.65 GiB total
Package updates All installed packages are up to date
OS type and version: Debian 10 Buster

Hi,

I am trying to populate my VPS with existing websites. I have installed the Wordpress script and successfully generated a test site. I tried the export/import functions within Wordpress which worked but the result was less than inspiring! Content was there but no theme. So I am trying to do it manually instead.

I have used ftp to download the existing site (Bluehost) and installed the contents into the new site on my VPS under the /wordpress directory. however, when I try to open a page (domain_name/worpress/index.php or other direct links) it just downloads an empty file to my computer. Clearly, the content is not there as it is all in the database structure.

So I see that a Mariadb database has been generated and linked to my new site and I assume all I need to do is populate it with the existing database content and all should work.

So I have exported the database (which is an SQL database) using phpmyadmin on Bluehost and it now sits on my computer. I just cannot find out how to import it to either my server (for subsequent manipulation into place) or into the Wordpress site.

I looked into installing the myphpadmin script but it tells me I do not have any SQL databases so it will not do it. So presumably I have to convert the SQL to a Mariadb format? How? Then upload it to the server? How (ftp) and where? Then I assume I will be able to import it into the site as it will be listed as an importable database? Or are there any further steps?

Appreciate some guidance please. I have several to do!

Geoff

Hi,

After successful installation of Virtualmin with install.sh script and going through the post-install wizard, do the following:

  1. Create new virtual server with the domain name used to host your WordPress site and make sure that it’s working (can be resolved (DNS working), can request SSL certificate and etc.)
  2. Go to Install Scripts page and install new WordPress for this newly created domain
  3. Go to File Manager and upload files from your previous WordPress installation under virtual server public_html directory, overwriting WordPress files that were just installed
  4. Go to Edit Databases page, choose the database for WordPress (named usually as yourdomain_wordpress), click manage and on the opened page click Execute SQL, where you can run SQL from file using an upload of your existing dump for your WordPress website.

That’s all.

Perhaps you would also need to manually adjust few option on wp_options table (for example, if domain name was changed) and adjust database settings in wp-config.php file (or simply not overwrite it on described above stage #3).

2 Likes

Thank you Ilia. I will try that later this evening. Much appreciated.

G

I wrote a Step-By-Step article on how to move/migrate WordPress in Virtualmin a few months back. You could check it out here: Migrate WordPress in Virtualmin [without plugin] - ShillongServer

1 Like

I’ve said it a thousand times before, I 'll say it again:

Use the All-in-one-migration plugin for Wordpress. It does a perfect job every single time. No headaches, no import issues, no database errors, no nothing.

1 Like

Ta Gomez,

I must have missed it when I was babysitting Wednesday.

Is it the ServerMask plugin you are referring to?

G

Might be this All-in-One WP Migration – WordPress plugin | WordPress.org English (UK)

1 Like

Hi again Gomez,

I do not share your confidence in all in one WP migration plugin. It did not work for me and it seems not to always work for others. Mine got stuck showing 100% and while the files were there, the site was not working properly. I am following a recommendation to use the restore option in lieu of the import option but that has been made a paid option so now I will have to downgrade the plugin and try again. I will persevere though as it is an easy enough option if it works.

I think the problem is that my site is 600MB and there is an inbuilt limit of 512MB in the plugin. This means I will have to limit the export to exclude say, images and then move them over manually.

I am also going to try the Duplicator plugin as an alternative.

Geoff

wp-cli works better than any plugin/gui. import files, change db details in wp-config.php , and run
wp db import db-dump.sql from root directory. that’s it.
edit] if changing to new domain, you might have to run `wp search-replace ‘$olddomain’ ‘$newdomain’ --all-tables to fix old urls in db.

in anycase, always keep backups…

@GeoffatMM Did you look at this at all from @shillongserver

1 Like

It is the one Whoops linked.

I’ve used it well over 100 times and never had a single failure.

Although, I do have an older version of it that’s good for up to 12 gigabytes. The newer version I believe limits you to how large your backup file can be.

guys client is saying that db was successfully imported in one way or another but there was an issue with theme - not loading. Client also not understand that there is no difference from sql and mariadb…

anyway long story short did anyone asked @GeoffatMM if client corrected domain name in phpmyadmin or whatever he is using for his db management?

Theme and some plugins will not load if imported db use old domain name different from originally installed on.

Edit: client or OP for me its same thing… its just professional deformation how I do reply to tickets past years :slight_smile:

Edit2: actually @Ilia nailed this already. I don’t get pointless discussion about pointless plugins by rest of the comments (speaking as webdev myself - yes wp themes dev etc…) after Illias comment. Its just noise. I guess client resolved his issue, that’s why he is no longer participating in this forum threat. - also sorry for my own noise.

2 Likes

Hi Unborn,

No it is not yet resolved as each transfer of 600 MB on my internet connection tales a long, long time. Plus I am building a house at the same time so I am usually setting this up late at night to see the results in the morning.

I will try to regress to an earlier version (Gomez, what version are you using?). I tried Duplicator but it was not as simple as All in one. I have looked at shillong server’s solution and will follow it as a last resort and I am currently looking into the cli solution.

I am not database savvy. I learned to get to grips with phpmyadmin but cannot find a similar management tool for the MariaDB databases so I cannot even look to see if the domain has been changed or not within the databases or even if they are there in full. Is there a module or package I can add to my server to give me similar control to phpmyadmin?

BTW I tried to install the phpmyadmin script (as I read it can manage MariaDB databases) but webmin refused as it says there are no SQL databases on my server. Is it possible to overcome this so it can be installed?

Geoff

Instructions are easy and I’ll repeat them here just to be thorough.

Install the plugin on the existing site.

Backup the site using the plugin and download the backup file.

Create the virtual server on Virtualmin.

Install Wordpress at top level on that Virtual Server.

Don’t do ANYTHING to the Wordpress install. Just install it and then immediately install the All in One plugin and activate it.

Upload the back up file to the ai1wm-backups folder using your file manager in Virtualmin. (It should be the first folder in your wp-content folder. If it isn’t there make it.)

Go to the plugin on the new Wordpress install and hit restore from backup and select the file you just uploaded.

Done.

Edit to add: can you please let me know once you have the file so I can take it down?

Thanks Gomez, I have downloaded it so you can remove the link.

How does this version differ from the basic 6.77 (which I also downloaded)?

G

It’s simple and it’s not limited as much. You can restore up to a 12 GB site with the old one. I think they limited the newer one to 1 or 2 GB and you have to pay to enable bigger file sizes.

Hi Gomez,

I am still having problems I’m afraid. Using the vanilla 6.77 version. I have removed media to reduce to 300Mb and followed instructions. It tells me the databases are restored but then hangs on finishing. How long should it take? Tried three times and it is not working!

I will install your version and try again to see if that works. However, I also want to remove the database changes so I have tried to set up sites on the virtualmin server that reflect my existing structure of domain.com and uk.domain.com. So I have set up a top level domain as domain.com than made a sub-server of uk.domain.com. The sub-server tried to install an SSL certificate (the top level domain did not fro some reason?).

I then tried to install the Wordpress script but it would not work and all I get is this message:


This script cannot be installed, as no compatible PHP versions were found

This script cannot be installed, as this virtual server does not meet its requirements : PHP version 5.6.20 or later is required, but this virtual server is using version


I get the same result when trying the top level domain as well. I have rebooted the server and it makes no difference.

I have successfully installed the script to the main server server on which webmin/Virtualmin is installed on so not sure what the issue is. Databases have been generated but I cannot see a reason why the PHP is not recognised.

Any ideas on how to get over this hurdle please?

[BTW, I am also getting lots of Page refreshed because of a problem issues. No idea if it is connected. I suspect not.]

Geoff

Is PHP set to Disabled on virtual-server.name - Server Configuration ⇾ PHP Options? If you create index.php PHP file with the following content:

<?php
  phpinfo();
?>

… and try opening it, what does it show?

Also, if you go to Webmin / Servers ⇾ MariaDB Database Server: MariaDB Server Configuration page, what does it look like (share the screenshot).

Thanks Ilia,

Just checking during my lunch break and you are right, they are disabled. I have set them both to FCGid (as per the working domain). This has enabled me to install the script for each of the two problem domains. However, I got the following messages of failed installs (for recommended but not obligatory packages).

Installing package(s) with command apt-get -y -f install php-pecl-imagick …

Reading package lists… Building dependency tree… Reading state information… E: Unable to locate package php-pecl-imagick

… install failed!

Installing package php-pecl-imagick …
Installing package(s) with command apt-get -y -f install php-pecl-imagick …

Reading package lists… Building dependency tree… Reading state information… E: Unable to locate package php-pecl-imagick

… install failed!

Installing package php-pecl-imagick …
Installing package(s) with command apt-get -y -f install php-pecl-imagick …

Reading package lists… Building dependency tree… Reading state information… E: Unable to locate package php-pecl-imagick

… install failed!

Installing package php7.4-pecl-imagick …
Installing package(s) with command apt-get -y -f install php7.4-pecl-imagick …

Reading package lists… Building dependency tree… Reading state information… E: Unable to locate package php7.4-pecl-imagick E: Couldn’t find any package by glob ‘php7.4-pecl-imagick’ E: Couldn’t find any package by regex ‘php7.4-pecl-imagick’

… install failed!

Installing package php8.0-pecl-imagick …
Installing package(s) with command apt-get -y -f install php8.0-pecl-imagick …

Reading package lists… Building dependency tree… Reading state information… E: Unable to locate package php8.0-pecl-imagick E: Couldn’t find any package by glob ‘php8.0-pecl-imagick’ E: Couldn’t find any package by regex ‘php8.0-pecl-imagick’

… install failed!

Installing package php8.1-pecl-imagick …
Installing package(s) with command apt-get -y -f install php8.1-pecl-imagick …

Reading package lists… Building dependency tree… Reading state information… E: Unable to locate package php8.1-pecl-imagick E: Couldn’t find any package by glob ‘php8.1-pecl-imagick’ E: Couldn’t find any package by regex ‘php8.1-pecl-imagick’

… install failed!

So I tried to install them through package manager and that gave the same error.

However, despite these failures, the message at the bottom of the script says it has installed and gives a link to compete the installation. However, that link takes me to my live sites (where the copy comes from) and gives an error message as the page cannot be found or it recognises that a Wordpress install already exists…

So I tried services: Preview Site and it works for my main (webmin) server domain but not for either the domain server or the domain subserver (both of which I installed at top level, not under the Wordpress directory). Instead of the site front page I get a blank page. Neither would let me log into /wp-admin.

I have looked at the Mariadb server and it appear to be right with the webmin server (xorex), the main domain server BFW and the subdomain (subserver) UK all showing Wordpress databases added.

I am a bit lost as to what to do now?

Any suggestions?

Geoff

UPDATE

I have just seen that although the databases have been made, they contain no tables. I am not sure if they should do or not. The main (webmin) server Wordpress site has a gamut of tables but not sure what I did (if anything) to get them.

G