title | description | published | date | tags | editor | dateCreated |
---|---|---|---|---|---|---|
Upgrade |
How to upgrade to the latest version |
true |
2023-02-07 05:38:49 UTC |
setup |
markdown |
2019-02-15 23:53:12 UTC |
DO NOT upgrade from
1.0.x
using these instructions! Use the Migrate from Wiki.js v1.x instructions instead. These instructions are for2.x
installations. {.is-danger}
While upgrades are generally safe and it's very unlikely that it would result in data loss, it's your responsibility to have a proper backup of your database before performing an upgrade. Note that it's not possible to go back to a previous version of Wiki.js once the database schema has been upgraded. {.is-warning}
Select your platform:
Upgrading is simply a matter of recreating the container with the latest image version:
# Stop and remove container named "wiki"
docker stop wiki
docker rm wiki
# Pull latest image of Wiki.js
docker pull ghcr.io/requarks/wiki:2
# Create new container of Wiki.js based on latest image
docker run -d -p 8080:3000 --name wiki --restart unless-stopped -e "DB_TYPE=mysql" -e "DB_HOST=db" -e "DB_PORT=3306" -e "DB_USER=wikijs" -e "DB_PASS=wikijsrocks" -e "DB_NAME=wiki" ghcr.io/requarks/wiki:2
Check out the Docker installation guide for all the possible options when creating a Wiki.js container.
The following commands will pull the latest image and recreate the containers defined in the docker-compose file:
docker-compose pull wiki
docker-compose up --force-recreate -d
The commands below assume an installation within a subfolder named
wiki
. {.is-info}
- Stop the running Wiki.js instance
- Make a backup of your
config.yml
file.
cp wiki/config.yml ~/config.yml.bak
- Delete the application folder.
rm -rf wiki/*
- Download the latest version of Wiki.js.
wget https://github.com/Requarks/wiki/releases/latest/download/wiki-js.tar.gz
- Extract the package
tar xzf wiki-js.tar.gz -C ./wiki
cd wiki
- Restore your config.yml back to its original location.
cp ~/config.yml.bak ./config.yml
- Start Wiki.js
node server
The commands below assume an installation at folder location
C:\wiki
. {.is-info}
- Open a Powershell prompt in administrator mode.
- Make a backup of
config.yml
file.
Copy-Item "C:\wiki\config.yml" -Destination "C:\config.yml.bak"
- Delete the application folder contents.
Clear-Content "C:\wiki\*"
- If you are using Windows 7 / Windows Server 2008 R2 or older, you must run the following command. (otherwise skip this step)
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12
- Download the latest version of Wiki.js:
Invoke-WebRequest -Uri "https://github.com/Requarks/wiki/releases/latest/download/wiki-js-windows.tar.gz" -OutFile "wiki-js.tar.gz"
- Extract the package to the final destination of your choice:
tar xzf wiki-js.tar.gz -C "C:\wiki"
cd C:\wiki
The tar utility is only available on Windows 10. On earlier versions, you'll need a 3rd-party utility like 7-zip to extract the file. {.is-warning}
- Copy your
config.yml
backup file back to it's original location.
Copy-Item "C:\config.yml.bak" -Destination "C:\wiki\config.yml"
- Run Wiki.js
node server
Read the transfer between servers guide to learn how to move an existing 2.x Wiki.js installation to a new server.
Note that the new server Wiki.js version doesn't need to match the old server. The installation will automatically be updated to the latest version upon restore. For example, it's perfectly safe to migrate a 2.2 installation on the old server to 2.5 on the new server. {.is-info}