{"id":21590961,"url":"https://github.com/spaceteam/wiki-migration","last_synced_at":"2025-06-29T11:32:37.807Z","repository":{"id":122271940,"uuid":"461231712","full_name":"SpaceTeam/wiki-migration","owner":"SpaceTeam","description":"Migrate the Space Team wiki from MediaWiki to BookStack.","archived":false,"fork":false,"pushed_at":"2022-02-22T14:26:52.000Z","size":657,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-18T10:15:26.672Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SpaceTeam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-19T15:28:36.000Z","updated_at":"2022-02-19T15:36:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"b275fed1-42d7-43fb-a3dd-d00cc819744f","html_url":"https://github.com/SpaceTeam/wiki-migration","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SpaceTeam/wiki-migration","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpaceTeam%2Fwiki-migration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpaceTeam%2Fwiki-migration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpaceTeam%2Fwiki-migration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpaceTeam%2Fwiki-migration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SpaceTeam","download_url":"https://codeload.github.com/SpaceTeam/wiki-migration/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpaceTeam%2Fwiki-migration/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262586168,"owners_count":23332802,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-24T16:21:19.454Z","updated_at":"2025-06-29T11:32:37.784Z","avatar_url":"https://github.com/SpaceTeam.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wiki-migration\n\nMigrate the old [Space Team](https://spaceteam.at/?lang=en) wiki from\n[MediaWiki](https://www.mediawiki.org/wiki/MediaWiki) to\n[BookStack](https://www.bookstackapp.com/).\n\n**1) Get a DB dump and images folder**\n\n[Paul](https://github.com/paulpaul168)\ngave me mysql dump of the old wiki and a folder of images (with many\nsubfolders).\n\n**2) Install mysql**\n\nI installed docker and started with the mysql docker image.\n\n```\ndocker run --name=mysql1 -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 -d mysql:latest\n```\n\nThis of course is not secure but that is fine as we only need it locally to pull it with python.\n\n**3) Import data into mysql**\n\n```bash\n$ mysql --host=127.0.0.1 --port=3306 -u root -p\nmysql\u003e CREATE DATABASE old;\nQuery OK, 1 row affected (0.00 sec)\nmysql\u003e ^DBye\n\n$ mysql --host=127.0.0.1 --port=3306 -u root -p old \u003c dump.sql\n```\n\n**Note:** The import may take a couple of seconds\n\n**4) Exploring the data**\n\nThere is an amazing\n[online documentation](https://www.mediawiki.org/wiki/Category:MediaWiki_database_tables)\nabout the tables in mediawiki. Some\ninformation was kinda outdated as the old wiki ran on a old mediawiki version\nbut after a bit of exploration I was able to put it visually together:\n\n![Database Diagram](db.png)\n\nAt this point I still needed to figure out in which subfolder I have to search\nto find an image. After a bit of searching I found [documentation how images are stored](https://www.mediawiki.org/wiki/Manual:$wgHashedUploadDirectory).\n\n**5) Run the Python script**\n\nLast, I spent a couple of evenings crafting the `main.py` script. Which will\npoll all pages from MySQL, replace all relative links with absolute ones to\nthe new wiki (so that linking between pages works), inline images, shell out to\npandoc to convert mediawiki to html and finally uploads them to BookStack.\n\nFirst copy `config-example.toml` to `config.toml` and edit the file (the\ncomments will guide you).\n\nCreate a virtual environment with `python3 -m venv venv` and activate it with\n`source venv/bin/activate`.\n\nNow install all requirements with `pip install -r requirements.txt`.\n\nFinally run the script `python main.py`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspaceteam%2Fwiki-migration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspaceteam%2Fwiki-migration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspaceteam%2Fwiki-migration/lists"}