Salvaging a Failed Wekan Upgrade: Exporting MongoDB Database
In this article, we will discuss the process of salvaging a failed upgrade of a self-hosted Wekan instance. Specifically, we will focus on exporting the MongoDB database, which stores Wekan's data, from the server to a local machine.
Background
Wekan is an open-source, collaborative, and customizable Trello-like kanban board application. It is built using Meteor, a full-stack JavaScript platform, and MongoDB, a source-available cross-platform document-oriented database program. Wekan can be self-hosted, allowing for greater control and customization of the application.
Upgrading a self-hosted Wekan instance can sometimes result in a catastrophic failure. In such cases, it is necessary to salvage the data stored in the MongoDB database. This can be done by exporting the database from the server to a local machine.
Prerequisites
To follow along with this article, you will need the following:
- Access to the server where the failed Wekan upgrade occurred
- Access to the MongoDB instance used by Wekan
- A local machine with MongoDB installed
Exporting the MongoDB Database
The first step in salvaging a failed Wekan upgrade is to export the MongoDB database. This can be done using the mongodump command.
On the server, navigate to the directory where MongoDB is installed. This is typically /usr/bin/mongodump.
cd /usr/bin/
Next, use the mongodump command to export the Wekan database. Replace database_name with the name of the Wekan database, which can be found in the Wekan configuration file.
./mongodump -h localhost:27017 -d database_name -o /path/to/export/directory
This will create a directory at the specified path containing the exported Wekan database.
Importing the MongoDB Database
Once the Wekan database has been exported, it can be imported to a local MongoDB instance using the mongorestore command.
First, start the local MongoDB instance.
mongod
Next, use the mongorestore command to import the Wekan database. Replace database_name with the name of the Wekan database and path/to/export/directory with the path to the exported database directory.
./mongorestore -h localhost:27017 -d database_name path/to/export/directory
This will import the Wekan database into the local MongoDB instance.
In this article, we discussed the process of salvaging a failed Wekan upgrade by exporting the MongoDB database. This can be done using the mongodump command on the server and the mongorestore command on a local machine.