How to import only last two years of topics and posts (phpbb3)

Hi! We’re in a process to make a move from phpbb3 to Discourse. We would like to not import older data and go for example with posts starting from year 2014 or 2015. How can this be done? Has anyone experience with such thing?

Either use a dump of your phpBB3 database where you removed all the old content or modify the import script to add a condition in the SQL queries to only retrieve new content.

2 Likes

I was hoping for more specific hint… preferably something simple and elegant and what works (something from personal experience maybe) :slight_smile:

Both these solutions work and are from my personal experience :wink:

2 Likes

but unfortunately too darn unspecific :stuck_out_tongue:

I have added code to several importers that does just that. Search the import scripts for IMPORT_AFTER for several examples.

1 Like

What if we use “last_post_id” and set it to something from which we know is the last post we don’t want to import? Could it work?

Here:
https://github.com/discourse/discourse/blob/5dbd6a304bed5400be481d71061d3e3ebb4d6785/script/import_scripts/phpbb3/importer.rb#L106