Migration tips: Difference between revisions

From Fundamental Ramen
Jump to navigation Jump to search
 
(21 intermediate revisions by the same user not shown)
Line 1: Line 1:
=== Update database by installer ===
== Steps ==
# Backup old database.
# Install the latest LTS version.
# Apply original database settings.
# Press continue to upgrade database by installer.


=== Update database by maintenance tool (for SQLite) ===
* Choose new image
# Backup old wiki.
* Update docker-compose.yaml
# Install the latest LTS version.
* Check docker-compose.yaml by docker compose config
# Generate a new '''LocalSettings.php'''.
* docker compose up
# Move SQLite file to the path of database.
* List package versions
# Run '''php maintenance/update.php'''.
* Test extensions
* Check file system permissions


=== Trouble shooting ===
== Choose new image ==
If a new primary key or unique key was defined in new version.


The SQL command '''INSERT INTO ... SELECT ...''' might be failed.
=== Comparison ===


At that time, the table cannot be migrate by updating tool.
{| class="wikitable"
! Image
! Included Web Server
! PHP Execution Method
! Base OS
! Recommended Use Case
|-
| <code>mediawiki:1.43</code>
| Apache
| mod_php
| Debian
| Simple deployment with a single container
|-
| <code>mediawiki:1.43-fpm</code>
| None
| PHP-FPM
| Debian
| Use with Nginx or an existing Apache server
|-
| <code>mediawiki:1.43-fpm-alpine</code>
| None
| PHP-FPM
| Alpine Linux
| Smaller image size for users familiar with Alpine
|}


# Export data of this table as SQL format.
=== package versions ===
# Run '''php maintenance/update.php'''.
# Import data manually.


=== Using Docker ===
<syntaxhighlight lang="bash">
It's easy to maintain requirements of MediaWiki by docker.
docker pull mediawiki:1.43.9
docker run -it mediawiki:1.43.9 bash


It's better to place some files and directories in volumes like:
cat /etc/os-release
php -v
php -m
curl -V
</syntaxhighlight>


* LocalSettings.php
=== debug ===
* mywiki.sqlite
 
* images directory
Permission problem usually arize when upgrade new version.
* custom extensions
At that time, bash into the container is necessary for debugging.
* php error log
 
* php-fpm error log
<syntaxhighlight lang="bash">
* nginx error log
sudo docker exec -it mw-main bash
* nginx access log
sudo docker exec -it mw-main mmdc -V
sudo docker exec -it mw-main bash -c 'echo $PATH | tr ":" "\n"'
</syntaxhighlight>
 
== from 1.39 to 1.47 ==
 
* Backup
** LocalSettings.php
** images
** database
 
<syntaxhighlight lang="bash">
docker compose exec mediawiki php maintenance/run.php update
</syntaxhighlight>

Latest revision as of 11:55, 4 October 2026

Steps

  • Choose new image
  • Update docker-compose.yaml
  • Check docker-compose.yaml by docker compose config
  • docker compose up
  • List package versions
  • Test extensions
  • Check file system permissions

Choose new image

Comparison

Image Included Web Server PHP Execution Method Base OS Recommended Use Case
mediawiki:1.43 Apache mod_php Debian Simple deployment with a single container
mediawiki:1.43-fpm None PHP-FPM Debian Use with Nginx or an existing Apache server
mediawiki:1.43-fpm-alpine None PHP-FPM Alpine Linux Smaller image size for users familiar with Alpine

package versions

docker pull mediawiki:1.43.9
docker run -it mediawiki:1.43.9 bash

cat /etc/os-release
php -v
php -m
curl -V

debug

Permission problem usually arize when upgrade new version. At that time, bash into the container is necessary for debugging.

sudo docker exec -it mw-main bash
sudo docker exec -it mw-main mmdc -V
sudo docker exec -it mw-main bash -c 'echo $PATH | tr ":" "\n"'

from 1.39 to 1.47

  • Backup
    • LocalSettings.php
    • images
    • database
docker compose exec mediawiki php maintenance/run.php update