Article 5Q79G Moving wordpress on new server

Moving wordpress on new server

by
gusto1
from LinuxQuestions.org on (#5Q79G)
I currently use LXC for wordpress

Code:LXC IP LAN 192.168.1.101
Debian 9.13
Apache/2.4.25 (Debian)
10.1.48-MariaDB-0+deb9u2 - Debian 9.13
PHP: 7.3.3Code:Wordpress 5.8.1plugins
Code:Advanced noCaptcha & invisible Captcha
Contact Form 7
Easy WP SMTP
NextGEN Gallery
Open External Links in a New Window
Shapely Companion
Simple Lightbox
SyntaxHighlighter Evolved
WordPress Importer
WP File Download Light
WP Table Manager Light
WPFront Scroll Top
WPS Hide Login
virtualhost config

Code:<VirtualHost *:80>
ServerAdmin admin@example.com
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/www.example.com/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RemoteIPHeader X-Real-IP
RemoteIPInternalProxy 192.168.1.105
</VirtualHost>There is an Nginx reverse proxy in front of the Apache server (IP 192.168.1.105). Everything works great.
I packaged the Wordpress directory tar.gz and also backed up the database.

Code:tar -cvzf /home/name/backup_wordpress-$(date +%Y-%m-%d-%H.%M.%S).tar.gz /var/www/wordpress
mysqldump wordpress > ~/wordpress-$(date +%Y-%m-%d-%H.%M.%S).sqlMy goal is to move to Debian 11.
I backed up the old LXC Debian 9 and created a new LXC Debian 11. The IP address for the new LXC Debian 11 remained 192.168.1.101.

New LXC

Code:LXC IP LAN 192.168.1.101
Debian 11
Apache/2.4.48 (Debian)
10.5.11-MariaDB-1 - Debian 11
PHP: 8.0.10I created The apache config

Code:sudo nano /etc/apache2/sites-available/www.example.com.confCode:<VirtualHost *:80>
ServerAdmin admin@example.com
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/www.example.com/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RemoteIPHeader X-Real-IP
RemoteIPInternalProxy 192.168.1.105
</VirtualHost>I unpackaged Wordpres to the new server, created a database and uploaded the tables

Code:sudo tar xvzf /home/name/backup_wordpress-2021-09-29-13.20.46.tar.gz -C /
mysql -e 'CREATE DATABASE `wordpress`'
mysql wordpress < wordpress-2021-09-29-13.20.45.sqlCode:sudo chown www-data:www-data -R /var/www/www.example.com
sudo a2ensite www.example.com.conf
sudo systemctl reload apache2Now when I put www.example.com in the url, I normally see my beautiful wordpress frontpage. Just like on the old servers.
However, when I click on a blog, it doesn't work, I just see it

Code:Not Found
The requested URL was not found on this server.I don't know where the problem may be.

When I tried to install a new wordpress on the new server, everything worked normally.

I made one more attempt. In the old servers, I deactivated all plugins in wordpress. I created a new backup of the wordpress directory and database.
I applied everything to the new server again (I have already described it once), but I did not solve the problem.latest?d=yIl2AUoC8zA latest?i=HTVyzf8FsNs:-eZFUzjU6-c:F7zBnMy latest?i=HTVyzf8FsNs:-eZFUzjU6-c:V_sGLiP latest?d=qj6IDK7rITs latest?i=HTVyzf8FsNs:-eZFUzjU6-c:gIN9vFwHTVyzf8FsNs
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments