I thought i would do it manually but I miscounted. There are approx 200 pages that need porting to the new site. So I've installed the FEEDS module and started playing.

I have copied an existing database table from the old website and exported one NEWS page to a csv file to test the Feed Import. It seemed to go OK but some info doesn't seem to have been accepted. The existing database fields are:

id, slug, datecreated, datechanged, datepublish, datedepublish, ownerid, status, title, image, teaser, video, body, eventdate, templatefields

Is there a way to map these to the new fields in BackDropCMS or do I just edit the above line in the CSV file before importing?  See bullet points below.

I just didn't want to generate a load of rubbish data on the new site by doing loads of test imports.

  • id: Doesn't seem to be directly related to BD node number. I understand BD needs this to be a unique value. So if I import in stages I do 1-100, 101-200 etc? Is that so that I can re-import (say) number 55 and BD will update the record previously imported? The old site has repeat numbering as below. Do I need to change this to 1-40, 41-70, 71-212 so BD gets a unique number across all imports?
    • Pages 1-40 (will be same in new BD site)
    • News 1-30 (will be REPORTS in new BD site)
    • Results 1-142 (will be same in new BD site)
  • slug: No equivalent in BD so can be dropped. Does BD just ignore it? If not I can edit the SQL table before export to drop it.
  • datecreated: Is this equilvalent to Authored on in BD? Do I just need to change the field title so BD imports correctly? Exports as following format: 21/04/2014 19:03 I've read something about import date formats somewhere but have lost where I read it.
  • datechanged: Don't think I need this imported.
  • datepublish: Does BD differentiate between this and Authored on or is there a BD equivalent?
  • datedepublish: Not used in old site. Always 0000-00-00 00:00:00. Is there a BD equivalent?
  • ownerid: This is a numerical value from the old site. This can be imported as adminEGTSC which is the current admin username.
  • status: for example published. Is there a BD equivalent?
  • title: Imported OK.
  • image: Typically "{""file"":""2014-04\/DSC2454SportsStarofYear4 (1).jpeg""}". BD imports the reference which is fine. I just need to copy across the images and update the record so it works correctly or is there a way to get BD to automatically drag it from the old site?
  • teaser: This is BD Summary ? If it's used on old site it is very infrequent and can probably be dropped.
  • video: similar to image above. Not sure it's used at all so can be dropped.
  • body: Imported OK.
  • eventdate: This is a content field. I just need to add this to the content-type definition.
  • templatefields: No equivalent in BD. Does BD just ignore it? I can edit the SQL table before export to drop it.

I was going to use Excel to do the manipulation but some of the body fields exceed XLS cell limits so I'll have to do it in SQL.

Comments

Hello Mike. I'm a bit unclear about some details in your question.

1. Are you trying to import content (nodes) from a Drupal 7 site into a Backdrop site? The columns you list look like the origin is not a D7 site - or at least this table is not the node table

2. When importing, are you wanting to create nodes in the Backdrop site with the information from the original table?

 

In Backdrop (as in D7), the node table contains very specific columns. All "fields" attached to content types in D7 and B are stored in separate tables. The nice thing about Feeds is that it can actually populate those other tables from the values in your CSV file.

All nodes (and all Backdrop entities) need a unique ID. There is no way around this. So, if your CSV data doesn't contain a unique ID column, you will need to create one before importing it.   

After that, you can map specific columns in your CSV data to specific columns in the node table. You do this within the Feeds UI, when you create your importer. 

For the remaining columns in the data that don't have a clear equivalent in the node table, IF you want to preserve those data, I'd suggest you attach fields to your content type to hold those data, BEFORE doing the mapping and the importing. You may also need to modify your data before importing to make it compatible with what Backdrop expect for specific fields. For example, if you want to store datepublish as the content of a Date field in Backdrop, you will probably need to provide that date in DATETIME format and UTC time zone.

However, some columns may be more problematic. For example, the image column. You could add an Image field to your node, but you have to make sure that the data provided in your CSV file matches what Feeds needs in order to populate that Image field. I'm not familiar with the process of importing fields that reference other entities (like Taxonomy, File or Image fields) with Feeds - I'd have to look more closely into it.

I hope this helps...

Hi

1. No. It's a Bolt site. Each content type is in one table. The Feed module seems to cope reasonably well as a first stab at it (accept the defaults and see what happens) but I'm looking to improve the configuration so I have less manual tidying up to do.

2. I think so. Isn't BD all nodes (ish)?

Having had a look at the database I'd figured out that BD stored it differently. Hence need for Feeds.

Mapping fields. OK I'll have a look.

Additional fields. OK I'll look through the detail and add the fields I want to keep into the BD content types.

Dates. I'm sure I read somewhere that some dates needed to be dd/mm/yyyy, others dd-mm-yyy in the CSV file but I can't find it again.

Dates. The second part of this is what are the field names in BD? I've had a bit of a look but I can't seem to find them.

Essentially, I'm trying to tidy the data as much as I can before porting to BD as Excel wont hack it as some of the body fields are over the cell limit in Excel.

HMmm...
The CSV file looks like this:

The mapping looks like this:

The eventdate doesn't import:

and the datepublished doesn't seem to work either:

I'm obviously not getting it quite right but not sure where I'm going wrong.
Any ideas?

 

Responding without having tested this. I think this is because of the format of your dates in the CSV file. It has to match that of the column.

For nodes, the created and changed date columns use Unix timestamps. For date fields, it depends on what you chose when you created the field. Two options: ISO format or Unix timestamp. ISO format should look like this if it doesn't provide a time: 2023-01-29 or like this: 2023-01-29T17:30:00.

The Unix timestamp is a long number... the number of seconds since Jan 1, 1970.

So, you probably need to change your CSV file to match these.

 

Thanks. I'll have another play.

Just received a reply for tech support and I cannot do it on my hosted site so I'll have to bulk import and tidy up in BD.

Or.. you could just download the CSV from your old site and tidy up using Excel?

Nope - Body field on some of the pages exceeds Excel cell size limit.

I see... 

I've never used Feeds Tamper before, but reading from the description it may be able to modify those date fields before saving. 

Ah!  Just as I'd imported 132 report pages.

TBH, today, I'd got to the stage where I don't want to spend much more time testing/configuring/etc plug-in(s) for a one time import. OK for a bigger record set but I might as well spend the time tidying in BD. It'll also help me to become more familiar with BD core functionality which will be useful going forward.

I don't have a deadline so I can do it as a background task.

Having said that it looks really powerful if you have 1000s of records to import.

Feeds / Feeds Tamper is the way to go for the future but not for me today with this website.

I did a recount and the actual number of pages was 365 so I installed FEEDS (painlessly I have to say!) and had a few trial imports.

I got the parsing working sufficiently well that I exported the database as CSV and imported using FEEDS.

Main tidying up was getting the links updated but apart from that all looks good.

There is some further tidying up to do but that's more to do with fitting in with how BackdropCMS works.

Only coding was a bit in the hero config to get white font rather than black.

<style>
h1 {text-align: center;}
</style>

<font size="7", color=white><H1>WELCOME TO EAST GRINSTEAD TARGET SHOOTING CLUB</H1></font>

Thanks to everyone that helped. Really appreciated.

If you want a peek it's at: www.egtsc.co.uk

 

Great stuff Mike. It's looking good and it's good to hear that importing has worked easily for you.