Imported Bookmarks Missing

I’m working on an import test from another board software, and I’m running into an issue with trying to import bookmarks. The base importer has the create_bookmarks function, and I’m passing in user_id and post_id values. The script does not throw any errors, and it shows the normal progress output:

25 / 25 (100.0%)

However, no bookmarks are created. The bookmarks table is empty (checking via the data explorer). Any ideas on why this would not be working as expected?

1 Like

You could add a puts after it calls the PostActionCreator and see if it’s creating anything.

1 Like

Ah, I may have missed the importers. I will take a look first thing today (I start in about an hour). There is a rake task you can run to sync bookmarks from post actions into the new table in the meantime.

bundle exec rake bookmarks:sync_to_table

This is a non destructive action and can be run as many times as you want.

6 Likes

Hmm. I looked in the post_actions table and it is empty as well. Is the import code using an outdated process here? I was considering just doing a direct insert query into the database but I’ll see if I can dig a bit deeper here as well.

I was quite surprised to see that there was support in the importers!

1 Like

I checked, and I did miss create_bookmarks in the base import script. I will get a PR up for that today so it creates bookmarks in the new table. It is very odd that it’s not making PostAction bookmarks for you though.

https://github.com/discourse/discourse/blob/master/script/import_scripts/base.rb#L587-L619

5 Likes

@Ghan I merged a PR https://github.com/discourse/discourse/pull/9603 that now creates the new bookmarks. Please give it a go and let me know whether it works for you!

5 Likes

I updated earlier today and bookmarks are now importing! Thank you for the quick fix!

3 Likes