A utility which can easily import file from another wiki.
- Destination Wiki API URL (Example: https://example.com/w/api.php)
- Import Source Wiki Main URL (Example: https://example.com/wiki/)
- A list of import filename
Also, this requires $wgAllowCopyUploads = true;
in the wiki's local settings and an account with the upload_by_url
user right.
- Turn to Special:BotPasswords on the Destination Wiki
- Fill in your username/passwords
- Create a new bot
- Remember to add upload permissions
- Save the bot passwords, it should be like
xxx@xxx
and a random key.
optional: You can save your credentials to 1Password, and fill in conf.yml
with secret reference URIs (op://).
- Download the latest build version from here.
- Decompress the file, creat a new directory (folder), and move
main.exe
. - Run the
main.exe
for the first time, and it'll create the fileconf.yml.example
. - Rename
conf.yml.example
toconf.yml
. - Fill in the Bot credentials previous fetched. Example:
bot:
username: xxx@xxx
password: 7aCTEJJM6eitNpJqmfsaPfERZmsQcawh
- Run
main.exe
and follow the instructions.
Sorry, but there's currently no other systems' version of this utility. Please turn to the development section.
- Prepare Python 3.10 + environment.
- Clone this repository.
git clone https://github.com/AlanYe-Dev/mediawiki-file-import-utility.git
. - cd into the directory
cd mediawiki-file-import-utility
. - Install requirements
pip install -r src/requirements.txt
. - Duplicate
conf.yml.example
, rename it toconf.yml
. - Fill in the Bot credentials previous fetched.
- Optional: Prepare a list of import filename to
import.txt
. - run
python3 src/main.py
Use PyInstaller to complete the build process. pyinstaller -F src/main.py
- Fork this repository, including the GitHub Actions
- Edit
src/main.py
or whatever you like, and the Actions will build your code everytime you edit it.
Please feel free to create new issues and pull requests in this repository!