-
Notifications
You must be signed in to change notification settings - Fork 360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added tools to import/export content #3354
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ package-lock.json | |
sandbox.sh | ||
vendor | ||
node_modules | ||
export | ||
**/*.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
{ | ||
"themes": [ | ||
"." | ||
] | ||
], | ||
"plugins": [ | ||
"https://downloads.wordpress.org/plugin/wordpress-importer.0.7.zip" | ||
], | ||
"mappings": { | ||
"./export": "./export", | ||
"./theme-unit-test":"WPTT/theme-unit-test#master" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,7 +141,30 @@ How do you wish to proceed? [1]" | |
cmd="rsync -av --no-p --no-times --exclude-from='.sandbox-ignore' --exclude=$ignore_string ./ $SANDBOX_USER@$SANDBOX_LOCATION:$SANDBOX_PUBLIC_THEMES_FOLDER/" | ||
eval $cmd | ||
|
||
elif [[ $1 == "export" ]]; then | ||
# Export the site content from your sandbox to a local file | ||
export_command='ssh $SANDBOX_USER@$SANDBOX_LOCATION "mkdir /home/wpcom/export ; rm /home/wpcom/export/* ; /home/wpcom/public_html/bin/wp export --dir=/home/wpcom/export"' | ||
download_command='mkdir ./export ; scp $SANDBOX_USER@$SANDBOX_LOCATION:/home/wpcom/export/* ./export/sandbox.wordpress.xml' | ||
eval $export_command | ||
eval $download_command | ||
echo " | ||
|
||
Export Complete! | ||
|
||
You can find the exported file in ./export/sandbox.wordpress.xml" | ||
|
||
elif [[ $1 == "export-theam" ]]; then | ||
# Export the site content from theamdemo to a local file | ||
export_command='ssh $SANDBOX_USER@$SANDBOX_LOCATION "mkdir /home/wpcom/export ; rm /home/wpcom/export/* ; /home/wpcom/public_html/bin/wp export --dir=/home/wpcom/export --url=theamdemo.wordpress.com"' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That should probably just change to use whatever URL you pass in like: ./sandbox.sh export theamdemo.wordpress.com instead of ./sandbox.sh export-theam allowing for ./sandbox.sh export peanutbutterbatter.wordpress.com |
||
download_command='mkdir ./export ; scp $SANDBOX_USER@$SANDBOX_LOCATION:/home/wpcom/export/* ./export/theamdemo.wordpress.xml' | ||
eval $export_command | ||
eval $download_command | ||
echo " | ||
|
||
Export Complete! | ||
|
||
You can find the exported file in ./export/theamdemo.wordpress.xml" | ||
else | ||
echo 'No known command given. [clean, push]' | ||
echo 'No known command given. [clean, push, export, export-theam]' | ||
|
||
fi |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this command assumes I have some exported content in
/home/wpcom/export already
? Is there a way I could specify a specific site of mine to export from?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that command will create the file in the /home/wpcom/export folder and then copy it locally.
It's a pretty hacky way to do it I think but I couldn't quite get things to work in another way. And Bash always just seems like a giant roll of duct tape to me anyway...
It would be a simple change to target a particular site defined in the command execution, yea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Truth be told I have NO idea where there's a
mkdir
followed by an immediaterm
so that's probably something that should change (even if it doesn't not work)