Skip to content
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

Import/Export posts #24

Closed
charliegroll opened this Issue Feb 5, 2012 · 31 comments

Comments

Projects
None yet
@charliegroll
Copy link

charliegroll commented Feb 5, 2012

The ability to import and export posts (perhaps just XML) would be very useful.

@ghost

This comment has been minimized.

Copy link

ghost commented Feb 5, 2012

Sure would! This'd take some planning, though.

@charliegroll

This comment has been minimized.

Copy link
Author

charliegroll commented Feb 5, 2012

I agree. I'm going to take a look at the db and everything to see if I can rig something together (after the Super Bowl and in between classes/work)

@rwarasaurus

This comment has been minimized.

Copy link
Member

rwarasaurus commented Feb 7, 2012

what would you import from and export to? applications wise? import from an rss feed?

@charliegroll

This comment has been minimized.

Copy link
Author

charliegroll commented Feb 7, 2012

I was thinking about importing/exporting all (or selective) posts for another anchor instance or a fork of anchor, if one should come about.

@rwarasaurus

This comment has been minimized.

Copy link
Member

rwarasaurus commented Feb 8, 2012

would you not just use a mysqldump? or are you thinking about migrating to different versions?

@charliegroll

This comment has been minimized.

Copy link
Author

charliegroll commented Feb 8, 2012

could, but i figured it would be more user-friendly to do it for them. i'm always thinking from a UX point of view, and the normal user wont' know how to mysqldump

@ghost

This comment has been minimized.

Copy link

ghost commented Feb 8, 2012

Also, I've been getting a bunch of people wanting to import their WordPress posts, so it might be useful for that, too.

@ghost ghost assigned rwarasaurus Feb 8, 2012

@charliegroll

This comment has been minimized.

Copy link
Author

charliegroll commented Feb 17, 2012

A friend of mine today was just noting how he is returning to WordPress from Tumblr and how WordPress can import from Tumblr — sounds helpful, as well.

@joshvickerson

This comment has been minimized.

Copy link

joshvickerson commented Jan 28, 2013

Has any progress been made on this front? I'd love to switch from Wordpress but if I can't transfer my posts it's difficult to justify.

@rwarasaurus

This comment has been minimized.

@iangcarroll

This comment has been minimized.

Copy link

iangcarroll commented Feb 15, 2013

Bumping an old issue here, but why don't we ask and include this in the main repo? Or better integrated into the installer

@daviddarnes

This comment has been minimized.

Copy link
Member

daviddarnes commented Feb 15, 2013

Because its not necessary for everyone? Its true that it can be very useful, however most people are starting a fresh when using this. An export button would be nice though, simple xml export.

@iangcarroll

This comment has been minimized.

Copy link

iangcarroll commented Feb 15, 2013

Why not at installation have
Create a new site or Import from WordPress

@simoncla

This comment has been minimized.

Copy link

simoncla commented Feb 15, 2013

If you have it on the installer it's still asking for an interaction and as david said it's not necessary for everyone.

It would make more sense to keep the installer as simple as possible and just have an import option on the back-end posts page.

"Create a new post" "Import posts"

@daviddarnes

This comment has been minimized.

Copy link
Member

daviddarnes commented Feb 15, 2013

I agree with @Simonclavey, however it would be best to have a simple xml import and export buttons in the metadata section. Understandably its awesome that we can now convert data from WordPress to Anchor, however Anchor needs to stay fresh and different. Having a WordPress import button will take it a step closer to "Another WordPress clone".

Sorry to harp on.

@iangcarroll

This comment has been minimized.

Copy link

iangcarroll commented Feb 15, 2013

Good idea. I think it should be integrated in there. Should I start work on a pull request to import WordPress sites using that script referenced above?

@iangcarroll

This comment has been minimized.

Copy link

iangcarroll commented Feb 15, 2013

To be clearer, in the Extend section, next to Metadata. I think it fits under 'extend'

@studioromeo

This comment has been minimized.

Copy link

studioromeo commented Feb 19, 2013

Really, this should be split into two separate issues.
For exporting I'd say JSON output is more friendly and lightweight. For those reasons I think it fits anchors mould better than any other format.

@oefterdal

This comment has been minimized.

Copy link

oefterdal commented Mar 8, 2013

How about adding post from markdown.md files? Super convenient when we are offline and want to write an article and a big + is that you can use any editor you want on any device.

@joshvickerson

This comment has been minimized.

Copy link

joshvickerson commented Mar 8, 2013

That would be awesome. It already supports drag/drop CSS and JS, why not drag/drop MD?

@rwarasaurus

This comment has been minimized.

Copy link
Member

rwarasaurus commented Mar 8, 2013

@oefterdal @joshvickerson Drag and drop .md files is a great idea.

@daviddarnes

This comment has been minimized.

Copy link
Member

daviddarnes commented Mar 8, 2013

Myself @studioromeo said exactly the same, you beat us to it @joshvickerson!

@oefterdal

This comment has been minimized.

Copy link

oefterdal commented Mar 8, 2013

Cool, Thank you for the support.

@daviddarnes

This comment has been minimized.

Copy link
Member

daviddarnes commented Mar 10, 2013

Would it be a step too far to be able to do this with html files too? Maybe some creative front end developers would benefit from being able to drag html, css & js into their articles?

@ghost

This comment has been minimized.

Copy link

ghost commented Mar 24, 2013

Original issue: importing works, thanks to http://samhellawell.info/index.php/posts/wp2anchor; exporting can be a plugin. Sorted.

@ghost ghost closed this Mar 24, 2013

@javiercuello

This comment has been minimized.

Copy link

javiercuello commented Nov 6, 2013

I've used wp2anchor to import my blog data from Wordpress. The import is done, but it seems that the text encoding is not the right one.

In the original .xml file, text is with Spanish characters, like in "sueños". But for some reason it seems that after that import characters look like this: "sueños".

If I write a new post, characters are OK.

Would you know how to fix this?

@tlongren

This comment has been minimized.

Copy link

tlongren commented Nov 6, 2013

Probably due to the import not setting default charset to utf8 when importing into MySQL. I haven't looked at the code though, so I could be wrong. Just throwing out ideas. --default-character-set=utf8 would take care of it.

@javiercuello

This comment has been minimized.

Copy link

javiercuello commented Nov 7, 2013

Well, unfortunately my PHP skills don't allow me to understand the code and try to help others fixing it.

I've tried changing the database character set to UTF8, and importing all again, with the same results.

@tlongren

This comment has been minimized.

Copy link

tlongren commented Nov 7, 2013

@javiercuello, in wp2anchor's import.php file, try adding this around line 187:

$mysql->set_charset("utf8");

Add that directly after this line (line 186):

wp2anchor_log("Connected to the database: " . $mysqlInfo["database"]);

That may or may not fix your unicode import issues. I haven't tested that, so no promises. :)

@javiercuello

This comment has been minimized.

Copy link

javiercuello commented Nov 7, 2013

Thanks Tyler.

I've kind of solved this directly replacing characters in my database. It would be great for someone to fix this wp2anchor for others having my same issues.

I've found other problems as well, concerning other things: importing from wordpress keeps some tags like the ones for < blockquotes >, < ul > and < em >. Ideally, it would be great to have some importing tool that convert this tags to the corresponding markdown.

So, I'm checking & fixing post by post, just to be sure all is OK.

Also, this import file uses almost the same information needed when installing Anchor CMS; so it would be useful to have an "import" field directly when installing anchor.

I'm just thinking out loud, but I think it's better to say this somewhere, and not keeping it for myself.

@joacimmelin

This comment has been minimized.

Copy link

joacimmelin commented Mar 26, 2014

A way to import from Wordpress, be it directly from a Wordpress database dump, by connecting to the Wordpress database or by be able to import a XML file would be great.

I have tried to get wp2anchor to work but it falls a bit short.

With larger XML files (20+ megabytes) the import fails. In my case, PHP is configured to handle up to 512MB files and the tmp-storage directory is defined with proper access rights. The result of this is a bit hairy:

The import fails with this message:

"Connected to the database: xxxxxxxxxxx
Cleared tables: anchor_categories, anchor_comments, anchor_page_meta, anchor_post_meta, anchor_posts
Set site meta [sitename] to []
Set site meta [description] to []

All existing posts and categories are wiped and none are created."

Smaller XML (5-6MB) files work, but the import script deletes any data already present in the database rather than add to existing data in the database which makes it impossible to import a huge Wordpress site step by step.

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.