16 Commits

Author SHA1 Message Date
Daniel Trostli
275a59fc25 add mysql port variable to script 2025-11-03 16:26:11 +11:00
James Loh
bb09cd2c2a Start MySQL container earlier on in migration
- The idea here is this can start up and do its thing in the background whilst we're rsync'ing content and saves us waiting longer later on
2025-07-09 17:15:30 +10:00
James Loh
511a50079f Add some additional help commands and a help script
no ref

- This should help users with the 'What next?' question at the end of their migration and gives them something to come back to once done
2025-07-09 17:15:30 +10:00
James Loh
87b0b3a556 Implemented some automatic search for Ghost installations
no ref

- Our docs suggest installation Ghost by default in `/var/www/` so search one level deep for Ghost installations
- If we find any, prompt the user if any of these are the ones they want to migrate otherwise let users prompt for a custom dir
2025-07-09 17:02:35 +10:00
James Loh
c18cc88f7f Make rsync progress quieter
no ref

- rsync will print us out a nice progress screen if we lower the verbosity which is nicer than outputting all of the files we're moving
2025-07-09 17:02:35 +10:00
James Loh
8411a38ccc Silence MySQL password errors
no ref

- Using a passsord on the CLI causes MySQL to print 'mysql: [Warning] Using a password on the command line interface can be insecure.' which doing via environment variables prevents
- This also fixes our other `cut` usages in the event the string has a
  `=` in it not printing the whole string
2025-07-09 17:02:35 +10:00
James Loh
c9b43fb74e Silence stopping Nginx
no ref

- No reason beyond making things quieter
2025-07-09 15:16:43 +10:00
James Loh
7f332ff9ac Start exposing Ghost on localhost and template port
no ref

- The thinking here is this allows users to more easily run multiple Ghost instances on the same server by templating the Ghost port
- Majority wont need this but it also simplifies the message around having to forward traffic if you don't start Caddy
2025-07-09 15:16:43 +10:00
James Loh
7bb2eec30b Don't prompt users to import configuration
no ref

- 99% of users will want to import their configuration by default so just do it and let users know
- We now just print the config we're importing then continue on
2025-07-09 15:16:43 +10:00
James Loh
0a64820e78 Migrate script: Copy and wording updates
no ref
2025-07-09 15:16:43 +10:00
James Loh
6890f5c4c6 Improved MySQL migration system
no ref

- Currently we prompt a user for a username to dump their Ghost database with which can be confusing if users can't remember their database details
- The Ghost user _likely_ has the required permissions to dump the database itself so we can first try that without prompting the user and _then_ prompt them if it doesn't work
- We added `--no-tablespaces` to the dump command to try and reduce the likelyhood of hitting users not having the `PROCESS` permission since most hosted DBs don't let this and Ghost's DB setup doesn't require DBs be dumped with that anyway
2025-07-08 15:57:13 +10:00
James Loh
cae06d8e1d Fix shellcheck issues 2025-06-30 21:16:16 +10:00
James Loh
2818e27fdc Rewrite migrate script to be more informative
no ref

- This adds disk space checks, MySQL connection checks and outputs more informative messages
- We go over what all the changes involve and add an escape hatch in the event that people want to back out or run into issues
2025-06-30 21:09:55 +10:00
James Loh
4251163b73 Add script to migrate existing Ghost config
- Ghost requires env variables to be in a special `__` format which is hard to construct manually
- This script automates that for ease of migration
- Currently doesn't meet our ESLint rules in the slightest so will need tweaking
2025-06-27 18:04:50 +10:00
James Loh
d13c2c1c8f Migration script: Make stopping Nginx optional
- People might have other systems running on server they want to migrate over first
2025-06-27 15:47:22 +10:00
James Loh
e065e8667c Add migration script for Ghost CLI -> Docker installs
- This script handles the copy of both assets and the MySQL database
  from an existing install to a new Docker based install
- Its currently been tested on the "happy path" of a Ghost CLI install
  and works
2025-06-27 14:40:27 +10:00