new custom command to update the service-URL in the database #994

Closed
opened 2026-02-04 23:20:50 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @ghost on GitHub (Jan 17, 2019).

I would love to see a new custom command like these:
https://www.bookstackapp.com/docs/admin/commands/

The new command should be able to update each and every occurance of the BookStack-URL in every table and column of the database.

This means it would have to accept two parameters:

  1. the old, possible invalid URL
  2. the new, currently working URL

example:
php artisan bookstack:update-url http://unsecure.old.link:8080 https://bookstack.new.url

Reason:
As (internal) Links and images are stored with the URL that was used when uploading the image or creating a link, these links might get broken if you migrate your BookStack-Instance to a new URL. This results in:

  • internal links not working
  • pictures not being displayed

Manually fixing these things via direct manual SQL-database editing might not be perfect for everyone as it's really easy to mess up, so a "ready to go"-command would be a blessing.

Originally created by @ghost on GitHub (Jan 17, 2019). I would love to see a new custom command like these: https://www.bookstackapp.com/docs/admin/commands/ The new command should be able to update each and every occurance of the BookStack-URL in every table and column of the database. This means it would have to accept two parameters: 1. the old, possible invalid URL 2. the new, currently working URL example: `php artisan bookstack:update-url http://unsecure.old.link:8080 https://bookstack.new.url` Reason: As (internal) Links and images are stored with the URL that was used when uploading the image or creating a link, these links might get broken if you migrate your BookStack-Instance to a new URL. This results in: - internal links not working - pictures not being displayed Manually fixing these things via direct manual SQL-database editing might not be perfect for everyone as it's really easy to mess up, so a "ready to go"-command would be a blessing.
OVERLORD added the 💿 Database📖 Docs Update🏭 Back-End labels 2026-02-04 23:20:50 +03:00
Author
Owner

@lieszkol commented on GitHub (Feb 7, 2019):

+1
I've actually written a short blog entry on this topic...

@lieszkol commented on GitHub (Feb 7, 2019): +1 I've actually written a [short blog entry](https://kb.zensoft.hu/migrating-your-bookstack-app-to-a-new-domain/) on this topic...
Author
Owner

@ssddanbrown commented on GitHub (Apr 9, 2020):

This feature is now in the master branch, ready to be part of the next release (v0.28). The docs will be updated with this new command upon release.

@ssddanbrown commented on GitHub (Apr 9, 2020): This feature is now in the `master` branch, ready to be part of the next release (v0.28). The docs will be updated with this new command upon release.
Author
Owner

@crainsaw commented on GitHub (Oct 15, 2020):

For those stumbling upon this feature request: The command is implemented exactly as proposed and documented on https://www.bookstackapp.com/docs/admin/commands/.

@crainsaw commented on GitHub (Oct 15, 2020): For those stumbling upon this feature request: The command is implemented exactly as proposed and documented on [https://www.bookstackapp.com/docs/admin/commands/](https://www.bookstackapp.com/docs/admin/commands/).
Author
Owner

@shortydutchie commented on GitHub (Jul 29, 2025):

TLDR;

Example: old url to new url
php artisan bookstack:update-url http://docs.example.com https://demo.bookstackapp.com

Afterwards - clear cache with
php artisan cache:clear

@shortydutchie commented on GitHub (Jul 29, 2025): TLDR; Example: old url to new url `php artisan bookstack:update-url http://docs.example.com https://demo.bookstackapp.com ` Afterwards - clear cache with `php artisan cache:clear `
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#994