0

I have gone through the /upgrade gui part on my website. However the geo location fields have not copied across.

Am I correct in thinking that instead of manually entering the data again, I could:

  1. Create the field (same name) and add it to the content types I was using.
  2. Export the field_data_field_location
  3. Import both these fields into the Drupal 8 database as field_revision_field_location respectively?

As far I can see the tables are pretty similar, although there are same number of fields 2 of them are different.

  • The D7 Table has a field entity_type
  • The D8 Table has field_location_data

I will attach the schema for both tables.

D7:

+------------------------+------------------+------+-----+---------+-------+
| Field                  | Type             | Null | Key | Default | Extra |
+------------------------+------------------+------+-----+---------+-------+
| entity_type            | varchar(128)     | NO   | PRI |         |       |
| bundle                 | varchar(128)     | NO   | MUL |         |       |
| deleted                | tinyint(4)       | NO   | PRI | 0       |       |
| entity_id              | int(10) unsigned | NO   | PRI | NULL    |       |
| revision_id            | int(10) unsigned | YES  | MUL | NULL    |       |
| language               | varchar(32)      | NO   | PRI |         |       |
| delta                  | int(10) unsigned | NO   | PRI | NULL    |       |
| field_location_lat     | double           | NO   | MUL | 0       |       |
| field_location_lng     | double           | NO   | MUL | 0       |       |
| field_location_lat_sin | double           | NO   |     | 0       |       |
| field_location_lat_cos | double           | NO   |     | 0       |       |
| field_location_lng_rad | double           | NO   |     | 0       |       |
+------------------------+------------------+------+-----+---------+-------+

D8:

+------------------------+------------------+------+-----+---------+-------+
| Field                  | Type             | Null | Key | Default | Extra |
+------------------------+------------------+------+-----+---------+-------+
| bundle                 | varchar(128)     | NO   | MUL |         |       |
| deleted                | tinyint(4)       | NO   | PRI | 0       |       |
| entity_id              | int(10) unsigned | NO   | PRI | NULL    |       |
| revision_id            | int(10) unsigned | NO   | MUL | NULL    |       |
| langcode               | varchar(32)      | NO   | PRI |         |       |
| delta                  | int(10) unsigned | NO   | PRI | NULL    |       |
| field_location_lat     | double           | YES  | MUL | NULL    |       |
| field_location_lng     | double           | YES  | MUL | NULL    |       |
| field_location_lat_sin | double           | YES  |     | NULL    |       |
| field_location_lat_cos | double           | YES  |     | NULL    |       |
| field_location_lng_rad | double           | YES  |     | NULL    |       |
| field_location_data    | longblob         | YES  |     | NULL    |       |
+------------------------+------------------+------+-----+---------+-------+

All help and advice appreicated!

Mark.

0

Turns out I was using the wrong version of geolocation. If you use the 8.x-1.11 when you run the upgrade script it pull over the geolocation data into your system. Although this isn't the default that composer installed for me, I had to re-install it.

Hope it helps someone out there,

Mark.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.