This tool support uploading folders.
We will let wordpress to create wordpress for us.
az container create \
--resource-group $ACI_PERS_RESOURCE_GROUP \
--name wp\
--image wordpress \
WORDPRESS_DB_USER=fennng@feng-test-mysql\
WORDPRESS_DB_PASSWORD=password\
--ip-address Public \
--ports 80 \
--azure-file-volume-account-name $ACI_PERS_STORAGE_ACCOUNT_NAME \
--azure-file-volume-account-key $STORAGE_KEY \
--azure-file-volume-share-name $ACI_PERS_SHARE_NAME \
--azure-file-volume-mount-path /var/www/html
Now, you should have your new wordpress working. Check your file share, you can see all the wordpress files generated by the container.
But this is the original wordpress files.
You need to upload your local wp-content folder to overwrite the default one.
Now, let's copy the wp-content file out to current directory
docker cp wp:/var/www/html/wp-content .
you can zip it to move to usb if needed.
zip -r wp-content.zip wp-content/
Then you can upload the whole folder to Azure
It will take a long time to upload a big folder.
It can be a good idea to create a container to unzip the file, make sure you backup and delete the wp-config.php file on the file share before doing this.
We will create an ubuntu container with ssh access.
az container create \
--resource-group $ACI_PERS_RESOURCE_GROUP \
--name ssh\
--image rastasheep/ubuntu-sshd \
--ip-address Public \
--ports 22\
--azure-file-volume-account-name $ACI_PERS_STORAGE_ACCOUNT_NAME \
--azure-file-volume-account-key $STORAGE_KEY \
--azure-file-volume-share-name $ACI_PERS_SHARE_NAME \
--azure-file-volume-mount-path /root
now ssh to it using it's ip address.
Note that you are in the risk of attacking.
So, the first thing to is changing the password, do this carefully, otherwise, you will not be able to login again. (you can still easily recreate the container)
passwd
once changed, logout and login again. It may take a minute before the new password works.
Now, you should upload the wp-content.zip to the volume using azure portal or azure storage explorer. You can also use psftp if you want.
Once uploaded
in your ssh shell, run apt-get update && apt-get unzip
then run unzip wp-content.zip
Now, type A to agree to replace all the files.
Wait for a few minutes.
Now, upload your wp-config.php file back to the server.
And then delete your ssh server.
az contain delete -n ssh -g testACI
Login to your wordpress, you plugins are back, but they are inactive. You have to reactive them.
You are done.