How to Change the Domain for BookStackApp

bookstack appchange domainupdate databasephp opcachexiaoz.me
Published·Modified·

Previously, the BookStackApp program was used to build the document system at doc.xiaoz.me. Unfortunately, xiaoz.me had its DNS resolution stopped by Alibaba Cloud, necessitating an emergency switch of the document system address to https://doc.xiaoz.org/. This article records the process of changing the BookStackApp domain.

BookStackApp Domain Change

Changing the BookStackApp Domain

First, modify the .env file in the site directory and change the APP_URL parameter to the new domain.

Next, you need to update the data to replace image addresses with the new domain. Execute the following SQL statements:

Update pages SET html= REPLACE(html, 'doc.xiaoz.me', 'doc.xiaoz.org');
Update pages SET text= REPLACE(text, 'doc.xiaoz.me', 'doc.xiaoz.org');
Update books SET description= REPLACE(description, 'doc.xiaoz.me', 'doc.xiaoz.org');

In the above commands, doc.xiaoz.me is the old domain and doc.xiaoz.org is the new domain. Please modify them according to your specific situation.

Finally, if your PHP components are using opcache, you will need to restart php-fpm.

This article references: https://github.com/BookStackApp/BookStack/issues/914