DEV Community

Cover image for How to unpack .wpress archive files created by the All-in-one-Wp-Migration Wordpress plugin

How to unpack .wpress archive files created by the All-in-one-Wp-Migration Wordpress plugin

Felix Haus on November 21, 2020

Recently I needed to download some files from a Wordpress installation where the client only gave me access to the admin dashboard. Fortunately the...
Collapse
 
goatcloud profile image
Cliff Rohde

Really brilliant, Felix. Many thanks for posting this.

Collapse
 
erionbrace profile image
erionbrace

Can someone help me understand how to navigate to the location where the .wpress file is downloaded because I don't know how to use node.js

Collapse
 
ofhouse profile image
Felix Haus

Which operating system (MacOs, Windows, etc.) do you use?

Collapse
 
erionbrace profile image
erionbrace

I use Windows

Thread Thread
 
ofhouse profile image
Felix Haus

Assuming the .wpress file you want to extract is in the "Downloads" folder you should be able to navigate there by running the following command in your CMD/Powershell first:

cd "$HOME\Downloads"
npx wpress-extract <downloaded-file.wpress>
Enter fullscreen mode Exit fullscreen mode

Other options to navigate to the Download folder in CMD/Powershell are shown here: stackoverflow.com/a/57950443/831465

Thread Thread
 
ofhouse profile image
Felix Haus

You could also open a CMD session right from the explorer by typing cmd right in the address bar of the explorer: howtogeek.com/235101/10-ways-to-op...

This will open a new terminal session from the directory that is opened in the explorer and you could start extracting:

npx wpress-extract <downloaded-file.wpress>
Enter fullscreen mode Exit fullscreen mode
Thread Thread
 
erionbrace profile image
erionbrace

After following all your instruction, now it says:
Error: Output dir is not empty. Clear it first or use the --force option to override it.

Thread Thread
 
ofhouse profile image
Felix Haus

This happens when a directory exists with the same name as the downloaded file.
e.g. when your file is named my-backup.wpress and there is a folder /my-backup in the same directory the extraction is stopped since it would override the content in the /my-backup folder on extraction.

You could simply rename the .wpress file (e.g. from my-backup.wpress to my-backup-1.wpress) to workaround this.

Thread Thread
 
erionbrace profile image
erionbrace

I can't thank you enough. This really helped me. Wish you all the best

Thread Thread
 
erionbrace profile image
erionbrace

Out of curiosity, is there any way to convert a regular file to a .wpress file?

Thread Thread
 
ofhouse profile image
Felix Haus

The reverse direction (creating a .wpress file from a directory) is a bit more complicated.
Inside the .wpress file are stored some metadata (e.g. installed plugins, Wordpress version etc.) that are not available in a local file context.
When providing this metadata manually, it would be possible to create a .wpress file.
But this is out of scope for me since I currently have no time to extend the tool further.

Collapse
 
blmurch profile image
blmurch

Thank you so much! Worked like a charm.

Collapse
 
deborahtrez profile image
Aanyu Deborah Oduman

Just like that! I didn't even have to download shit. Thank you!!

Collapse
 
jakeadriano profile image
Jake Adriano

I created an account here just to say: thank you. Thank you so very much. Works like a charm.

Collapse
 
ofhouse profile image
Felix Haus

Haha, nice 👍
Messages like yours always make my day a little brighter, thanks for your support!

Collapse
 
tko profile image
TKO

I've been struggling trying to extract files from a corrupted backup using the instructions you provided. Is there a video or a more detailed step by step tutorial on how to extract files from a .wpress file? Preferably using terminal

Thread Thread
 
ofhouse profile image
Felix Haus • Edited

The program itself works sequentially, so when the beginning of the file is correct it extracts the files up to the point when the file becomes corrupted.

While writing the program I used Visual Studio Code to take a look inside the .wpress files.
It is at least able to show the source code from the files that are packaged inside the archive.

Collapse
 
brams_s profile image
Brams

Amazing tool! Exactly what I was looking for when trying to migrate a website to a different server. Currently abroad with very slow internet here. Decided to make a DigitalOcean droplet and use its fast connection to download the 5GB migration file directly to the server with curl.

Then I needed a way to unpack the wpress file and your npx tool came in clutch. Saved me 3+ hrs of download time. Thank you very much!

Collapse
 
volverainc profile image
volverainc

very helpful, thanks a lot!

Collapse
 
vaclav_keil profile image
Václav Keil

Hi Felix, Thank you very much for this tool. I like the way the JavaScript programming was done. If only more npm packages could be simple yet effective like yours.
It runs with the current LTS version of Node.js.

Collapse
 
ardelisinbaking profile image
ardelisinbaking • Edited

the tool installed nicely, and extracted the .wpress file nicely, but flywheel wont accept the import for some reason: We couldnt figure out what to do with the import file provided. Please extract it manually.; it looks extracted to me though..

Collapse
 
wazoooguru profile image
WazoooGuru

Solved my issue where I had a backup from a Multi-Site that I could not import unless I purchased an insanely expensive All-In-One extension. Also couldn't import it into Single site setup or even FTP transfer the 5GB file into the dev server due to size. I literally just needed the image directory. Anyways - THANKS!

For clarity to noobs like me (relatively), I may offer these tips to get it to work on a Mac Terminall:

  1. The Terminal command to navigate to a directory is: cd ~/DirectoryName not just ~/DirectoryName
  2. I had to replace the word 'migration.wpress' in 'npx wpress-extract migration.wpress' with the actual file name, so the command is 'npx wpress-extract FileName.wpress'

Good luck!

Collapse
 
axltrauts profile image
🍜 Stuart Graham

Hi, can you please show me the steps you take to restore the backup on the new server?

I uploaded the extracted files, overwrite the duplicate files and run the SQL within. So far it looks like nothing happened, the wordpress looks like a new installation.

Collapse
 
arnoldflexy profile image
ArnoldFlexy

Thank you so much, it worked!!!

Collapse
 
ofhouse profile image
Felix Haus

Great to hear, happy to help 😊

Collapse
 
evoratec profile image
Juan Antonio Navarro

Great tool. Thank you very much.

Collapse
 
ofhouse profile image
Felix Haus

You are welcome, thanks for the feedback 😊

Collapse
 
sebastionny profile image
Sebastian Mendez Garzon

Wow. Beautiful. Easy peace!

Collapse
 
said_mounaim profile image
Said Mounaim

Thanks! Worked

Collapse
 
vpn profile image
Patrick

Thanks for this!

Collapse
 
codywilliamson profile image
Cody

This is great!!! Was in a bind due to a really large export and did not know an easier way to unpack the file. Thanks so much!

Collapse
 
deborahtrez profile image
Aanyu Deborah Oduman

Could you be knowing how to deploy the extracted site to GitHub with gh-pages?

Collapse
 
ofhouse profile image
Felix Haus

Not sure if I understand your question correctly.
Since Wordpress requires a PHP runtime which gh-pages does not provide, uploading .php files would only result in people seeing the source code when visiting the GitHub page.

Collapse
 
tko profile image
TKO

Is there a video that demonstrates how to unpack .wpress archive files using a Mac?

Collapse
 
ofhouse profile image
Felix Haus

No, since the process and used commands are the same whether you are using a Mac, Linux or Windows machine.

Thought about making a video from it, but then discarded the idea since it would only show me how I would badly type in the command from the post in my terminal 😅

Collapse
 
ste6412 profile image
Stephen Hamill

Worked like a charm! Thank you for this

Collapse
 
ofhouse profile image
Felix Haus

You're welcome! I'm amazed how many people already used it 😀

Collapse
 
madurapa profile image
Maduka Jayalath

Awesome mate! Thanks!

Collapse
 
yoel3imari profile image
يوسف العيماري

thank you very much

Collapse
 
muktoapb profile image
Mahidul Islam Mukto

Great it help me a lot. easy and simple. thanks

Collapse
 
eightbit profile image
Mitch

Thanks so much!

Collapse
 
eswarrajs profile image
Eswarraj

You are lifesaver!! Thanks Felix

Collapse
 
becmania59 profile image
becmania59

Sorry if this is obvious, how do I install your tool? Windows

Collapse
 
amuhareb profile image
amuhareb

thanks for this! Super helpful

Collapse
 
alidotworks profile image
Ali Works

Thank you so much. It is very helpful and to the point tutorial.

Appreciating your simplicity.

Collapse
 
svsdesign profile image
Simon van Stipriaan

Still works :) Thanks!

Collapse
 
mrcx profile image
Mircea G

Lifesaver! Thank you very much.

Collapse
 
sahoojanardhan profile image
Janardhan Sahoo

hey hi.. while extracting its stuck in 94% ..
Image description

Collapse
 
mobile75 profile image
Luca

Thanks! when I have unzip .wpress file, how can I upload and reinstall all my site? and what about db? thanks for helping me

Collapse
 
mobile75 profile image
Luca

Please, then I unzip .wpress file, how can restore all on my "new" worpress website? and what about database? help me, thanks

Collapse
 
maheshsekar profile image
maheshsekar

hello Felix thanks for this idea!

but i'm facing some errors like directory path like so what to do to extract .wpress files? Is there any possible ways? in 2023 June?

Collapse
 
madre profile image
TUA

NON FUNZIONA UN CAZZO DIO MERDA

Collapse
 
aakashe2dev profile image
Aakash Mittal

Really great, It has solve my problem. I want to check my last backup for plugins but if I upload backup then my all updated work will lost it really help me. Thanks you for this code snippets

Collapse
 
callworthp profile image
callworthp

THANK YOU! This worked awesome and saved me a lot of pain.

Collapse
 
truegryc profile image
Andy Gryc

Fantastic! I also created an account just to leave my thanks. People like you make the internet great. Thank you Felix!

Collapse
 
steckinsights profile image
Steck Insights

Brilliant. Well done. Thank you @ofhouse!

Collapse
 
clarinogueira profile image
Clari Nogueira

Hi. Can someone help me navigate to the location because I keep getting the "permission denied" and "command not found". I use Mac M1 and the .wpress file is in users/mc/downloads... Thank you!

Collapse
 
brams_s profile image
Brams • Edited

Hey, I was also getting a permission denied warning when using this on a 20.04 ubuntu droplet on Digital Ocean.

I moved it to another directory where I had more rights and it worked like a charm. Seems to be related to your write permissions for the folder were your migration.wpress file is trying to unpack

Collapse
 
mrrich50 profile image
MrRich50

Thanks Felix! Works like a champ.

Collapse
 
hgroman profile image
hgroman

Thank you so much!!! I also created an account just to say thank you. You rock.