Created
June 22, 2012 21:31
-
-
Save Pistos/2975316 to your computer and use it in GitHub Desktop.
Dumping posts and comments out of Diaspora database
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
# Set author_id to desired people table record id | |
echo 'SELECT c.id, c.guid, p.guid AS post_guid, c.created_at, c.text, c.likes_count FROM comments c, posts p WHERE p.id = c.commentable_id AND c.author_id = 3 ORDER BY c.id' | psql -U diaspora -h localhost -A -F ' | |
' -R ' | |
--- record | |
' diaspora_production > diaspora-comments.dump |
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
# Set author_id to desired people table record id | |
echo 'select id, guid, created_at, text, likes_count FROM posts WHERE author_id = 3 order by id' | psql -U diaspora -h localhost -A -F ' | |
' -R ' | |
--- record | |
' diaspora_production > diaspora-posts.dump |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment