Moving sites with AWStats from DirectAdmin to Virtualmin

Looking at a DirectAdmin site, I see it has an “awstats” directory in the domain.com directory. In that AWStats directory contains:

awstats.pl that I believe is run each 24 hours to generate the newest stats

.htaccess

all the .html files from when the site was set up (back thru 2017 in the one I am viewing)

I’m in the same boat, Joe, probably 10-15 years ago I was setting up AWStats on Windows servers and my recollection is that I set them to run the perl processor each midnight and they generate .html files that are organized under a main index.html which is also updated each update. So it doesn’t appear perl is used other than the processing/generating.

In the DirectAdmin backup (backup-Aug-12-2024-1.tar.zst) file all the components of the site appear to be present:

“backup” folder - contains a folder named email_data, one named the domain name (has, inter alia, certificate parts), history and files that appear to be text files containing mostly various settings

“domains” folder - contains only a folder named the domain name (there was only one domain in this site space) which contains these folders: .htpasswd, awstats, logs (last few days), public_ftp, public_html, and stats (has Webalizer stats)

“imap” folder - contains a folder named the domain name which is empty - makes sense because I generally do not run email on web servers

After running a migration, there is no indication that Virtualmin made an attempt to deal with AWStats. It is as though it was skipped. Virtualmin did bring in the Webalizer in totally working order.

This site is different than the original one I migrated in that it is a WordPress site. After the migration I get a database connection error which I am hoping is just a password issue in the wp-config.php file. I have noticed that in Virtualmin the password for the user is used in the database connection. It is probably my ineptness in Virtualmin not knowing how to set up new sites that I haven’t figured out how to change that.

EDIT: had to change the DB user and DB password in the WordPress site’s wp-config.php file to the Virtualmin user values and it connected to the database. Perhaps that could be built into the migration.

You guys are a few steps ahead of me. Let me be more specific; this is how I generate the backup in DA:

There’s no AWstats installed, only Webalizer although I could care less if this is copied over or not.

I was lead to believe I do NOT have to create a virtualserver first, but I could just go to Migrate Virtualserver and follow the steps @charlesworks was kind enough to lost, apart from installing Webalizer since I still can not find recent documentation howto.

The red bar swings left and right for some time and than nothing. No point in finding the AWstats configuration I think @stefan1959 since the server is not created. It’s not parts of the virtual servers list, since the import didn’t work. Can I somehow find or see a log of what it is trying to do when I hit the ‘Migrate Now’ button?

Or, could this really be the result of not having Webalizer installed?

You have not mentioned which OS, Webmin & Virtualmin versions do we assume that you are running a system exactly the same as charlesworks ?

You’re absolutely right. Sorry.

Ubuntu Linux 20.04.6
Webmin 2.111
Virtualmin 7.20.2

Also just installed:

Webalizer version 2.23-08

Sorry, for a moment it looked like it worked. This time I uploaded the backup first and used the option for a local file. This time is succesfully created everything, including the virtual server.

there were some unused subdomains on the direct admin server which took a long time for the SSL requests to finish and to figure out to use a self signed version. Maybe during the upload attempt it timed out.

Anyways…a white page appeared for my VERY important website with webshop. I can’t even get ftp to work.

I have no clue how I’m going to test this migration without having downtime on the website…

Ok, step by step. I changed the DNS back to the old server to let the website up. Used the hosts file to point to the virtualmin server.

  • White screen. The PHP logs and a search on the internet taught me that there was a line with auto_prepend_file in the user.ini that pointed to a wordfence-waf.php file that needed commenting out.
  • Switched to debug mode in wordpress.
  • Next challange; user denied for database connectoin.

The error:
Warning: mysqli_real_connect(): (HY000/1045): Access denied for user ‘xxxxxx_wp2’@‘localhost’ (using password: YES) in /home/xxxxxx/public_html/wp-includes/class-wpdb.php on line 1982

Access denied for user 'xxxxxxxx_wp2'@'localhost' (using password: YES)

(names have been changed by xxxxx).

When editing users. I noticed the user xxxxx_wp2 has nothing in the field ‘Database granted access to’. So I thought I 'll grant this users access to the xxxxx_wp2 databse only to find out it wants me to change the password. I wouldn’t have a clue what the original password once was. So I really hope this isn’t necessarry. Doesn’t make sense either.

Or am I overlooking somehting entirely different?

This worked around the database connection problem for me.

Also, remember that the directory structuring is different between DirectAdmin and Virtualmin.
DirectAdmin:
/home/username/domains/domain.name/public_html
Virtualmin:
/home/username/public_html

Plugins that rely directly on the directory structure most likely make the change in wp-config.php (e.g., most caching plugins) and correcting it there usually resolves things quickly.

Thanks @charlesworks But I’m afraid I need a bit more details. Changing it to the “Virtualmin user”? Who is the virtualmin user? Until the migration there was no user. Now there’s an owner and a bunch of other users migrated from Direct Admin. It kinda looks like this now:

I changed wp-config to the owner User 1 in this example and it’s password but that didn’t work. I did not expect it to, simply because I assume the database has the opriginal password stored somewhere, that is also in the wp-config file.

However, it does look like the owner User 1 is th eonly one who has Login access to a Databse. So, I would assume the other MySQL users would need that to, and somehow lost that privilage diring migration?

I ‘can’ imagine I may have to change the password of User2_wp2 (which is the needed user and database) to the password as it is mentioned in wp-config.

Or am I missing it completely?

The Virtualmin user is the Linux username of the web space and its password (same as FTP access into the site).

The site I used to test this is a WordPress site and only had one user in it, so apparently isn’t as complex as your situation.

When I initially did the migration into Virtualmin, I was unable to complete it unless I entered the original site’s password (or maybe it just wanted me to set a password, I do not know) so I used the site’s DirectAdmin password.


your image does not look correct there are no links to the user account but you could have removed the other columns that are not present. Perhaps edit “User1 OWNER” password to suit what you have in your software config

Indeed I do not have the columns Disk quota, Quota used and last login. I checked other accounts (not migrated ones but made from within virtualmin, and they also lack those columns. I also do not understand why my list of database users do not show Database in the last column called Login Access, but maybe that’s not necessarry. I changed the applicable database user (it’s in my php-config file, so I know the right one) and try to ‘change’ the password to the pw mentioned in the php-config file, still no connection. I seems to be missing more. Maybe my virtualmin install is not complete?

Add the new IP to your local hosts file. There is never any reason to have downtime for testing a migrated domain.

Wait, what the heck. There are two completely different conversations happening here?

Please make a new topic for your problems, please don’t hijack other folks threads.

I’m locking this thread, as the original topic has been solved, as far as I can tell from above.

https://forum.virtualmin.com/guidelines

Er, wait, maybe the original topic is not resolved? I can’t tell, there’s too much going on here.

@charlesworks is there still an issue you’re trying to resolve before this topic got hijacked for a different problem?

Joe, the original problem has not been resolved. I provided a DirectAdmin site backup to @Ilya and @Jamie. It is appearing to me there may be a bug in the migration process involving DirectAdmin backup migrations and that may be why the AWStats were unable to migrate (as well as a number of other migrated site functionality and settings).

As this thread progressed, it is apparent I should have initially named it “Migration from DirectAdmin to Virtualmin issues”.

Nobody is intentionally ‘hijacking’ any threads Joe. I wasn’t even aware anymore since @charlesworks was so kind to share his experiences on a similar migration.

But before you freak out completely, here’s the new threads you so kindly suggested: Migrating my site from DirectAdmin to Virtualmin issues

Thanks for all the support!

I asked two weeks ago, as well. Moving sites from DirectAdmin to Virtualmin - #8 by Joe

Joe, I didn’t mention the mail aspect of the migrating from DirectAdmin because I generally run separate mail servers. But in the case where one IS using email that is managed through the web space, shouldn’t it migrate over as well during the migration process?

If so, then all of what @Robert71 is trying to solve is within this thread’s topic, isn’t it?