imlzhyt

没有楼的楼长的博客

摸摸摸摸摸摸摸摸鱼!
steam
telegram
github

Record the pitfalls encountered when configuring Typecho after changing servers and databases.

Summary

It was difficult to register, so I decided to rent a foreign VPS and finally use a domain name.

System Versions

Domestic cloud server: Centos7.9 Apache Mysql5.7.38, see this article for details.

Foreign cloud server: Ubuntu20.04 Nginx1.18.0 Sqlite3 3.31.1

Troubleshooting Process

First, I installed MySQL on the foreign server, but it was using several hundred MB of memory, which overwhelmed my small machine. So, I decided to switch to SQL. Previously, I had used PostgreSQL for a QQ robot and found that it didn't use much memory, so I installed it.

I used Navicat locally to convert the original server's MySQL to the new server's PostgreSQL, referring to this tutorial. After the conversion, I found a problem with testing comments. I thought there might be an issue with the structure conversion during the database transfer, but I couldn't figure it out after trying for a long time. During this process, I discovered that when importing data from a txt file using Navicat, I needed to change the current value of the sequence for tables with sequences; otherwise, duplicate values would occur during the next addition. Finally, I realized that the problem was with the comment email notification plugin I was using, called CommenttoMail, which doesn't support PostgreSQL. It only supports MySQL and SQLite, so I had to switch to SQLite.

SQLite is similar to PostgreSQL, but it requires creating a local db file and granting read and write permissions. I used Typecho installation to build the database structure, so I didn't need to convert the original MySQL to SQLite using Navicat. Then, I downloaded the db file to my local machine and imported the previous data into it. I was worried about potential issues, so I selected all options in Navicat's maintenance options after importing, but I'm not sure if it was necessary. I didn't use remote connection because I didn't want to deal with PHP and such.

Finally, don't forget to change the permanent link of the blog! I forgot about this and was frustrated for a long time because the material images couldn't load.

Having a domain name feels great.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.