Identity value incorrect after migration to Azure SQL

I used the new MS Data Migration Assistant (v4.1 link) to migrate a database from a SQL 2008 R2 server to an Azure SQL database. The process worked well and the data migration worked great!

However, after starting to use the Azure database from the application, a table with an identity column (defined with IDENTITY(1,1)) failed when a new record was added. The last record in the table had a value of 207170 in the identity column when the database was copied.

The first attempt to add to that table failed with the error:

Cannot insert duplicate key in object X. The duplicate key value is (207168).

As you can see, the number that the new record attempted to use was 207168. But that record already existed. The next attempted failed using 207169. The next attempt failed as well. But the next one worked fine and used 207171.

So, it seems like the identity value for that table was 3 numbers lower than it should have been.

After encountering this, I ran DBCC CHECKIDENT ('table', NORESEED ) on every table in the database. None of them appear to have a problem and inserting a record into another table worked fine.

I think when I do the next database migration, I will run BDCC CHECKIDENT on every table to ensure that the identity values are correct.

Has anyone else had this problem? Is there a way to avoid it?

Why was there little nonwhite migration to Europe in the 19th century?

Migration

This may sound like a strange question, but hear me out.

The 19th century was an age of massive population migration, perhaps the most significant in history according to this economic history course. Large numbers of Europeans (British, German, Scots, Irish) emigrated to overseas colonies, often despite very hostile conditions. Many Asians also pulled up roots and moved vast distances, despite the efforts of white governments to keep them out. For example, the British transported 3.5 million Indian indentured laborers to colonies across the world, Chinese immigration played a role in both the California and Australian gold rushes. But despite colonial entanglements all over the world, few Asians, Africans, Middle Easterners, and Latin Americans appear to have reached Western Europe.

Immigration

Europe then was an obvious source of wealth and innovation, and regularly hungry for cheaper labor. And yet there was very little nonwhite immigration there, prior to 1945. There were slaves before abolition, some Chinese communities that never rose over a few thousand, and small groups of students from various colonies. Ironically, large scale immigration to Western Europe appears to have only begun after WWII and the end of the colonial empires.

> Why was there little nonwhite immigration of to Western Europe before the postwar era? And are there any examples of larger-scale immigration being explicitly considered or rejected?

I half-expect the answer will boil down to racist paranoia, white workers not wanting competition, and the difficulty of surmounting linguistic and cultural barriers. But, at the same time, that wasn’t enough in the U.S. or Australia, and it didn’t stop the Irish, Poles, or Jews. Regardless, thanks for your time.


(I’d like to add that this question has zero political motivation. I’m an American reading about British, and west European, imperialism in the 19th century, and the question just struck me.)

Element-api migration – entries by category

I am having trouble getting the related category passed thru to the entry api endpoint.

I cant use :

   $criteria = craft()->elements->getCriteria(ElementType::Category);
        $criteria->id = $catId;
        $category = $criteria->first();

What is the equivalent in craft 3 api v2?

'api/v1/ship/category/.json' => function($catId) {
//old api craft 2
        $criteria = craft()->elements->getCriteria(ElementType::Category);
        $criteria->id = $catId;
        $category = $criteria->first();

//api craft 3
        return [
            'elementType' => Entry::class,
            'elementsPerPage' => 30,
            'criteria' => [
                'criteria' => ['section' => 'ship'],
                'relatedTo' => ['targetElement' => $category],
            ],
            'transformer' => function(Entry $entry) {
                return [
                    'title' => $entry->title,
                    'id' => (int) $entry->id,
                    'slug' => $entry->slug,
                    'postDate' => $entry->postDate
                ];
            },
            'pretty' => true
        ];
    },

Production REP token contract migration process

What occurred during the production REP token contract migration scheduled to begin at 11AM PST on August 9th?

This is an automatic migration, meaning REP token holders do not need to do anything. While there is not an exact timeframe of how long migration will take, the estimation is 8 to 10 hours, assuming there are no hiccups and all goes well.

What happens during the estimated 8 to 10 hour migration period?

  • Is there migration code that handles the new REP token contract being minted 1:1 to all REP token holders or will this handle some degree of manual intervention (for exchanges or other parties)?
  • What method was used to validate the 1:1 minting based on all REP token balances at the time of the migration?

Drush Migration between distant DB and local DB?

I’m trying to set migrations between an online D6 website and a local D8 one.
So I want to connect to D6 DB like this:

drush @vmdevd8ce  migrate-upgrade --legacy-db-url=mysql://d6dbuser:d6dbpass@d6server/d6_distantdb --legacy-root=http://www.d6url.com --configure-only

drush @vmdevd8ce  migrate-upgrade --legacy-db-url=mysql://d6dbuser:d6dbpass@d6serverdistantdb  --legacy-db-prefix=dbpref_ --legacy-root=http://www.d6url.com --configure-only  --debug

My distant DB have a prefix name but no prefix table name.
But I get PHP error :

PHP Fatal error:  Call to undefined method DrushSqlSqlBase::dbSpecFromDbUrl() in /var/www/drupal-8/modules/contrib/migrate_upgrade/src/MigrateUpgradeDrushRunner.php on line 131
Drush command terminated abnormally due to an unrecoverable error.                                                                                               [error]
Error: Call to undefined method DrushSqlSqlBase::dbSpecFromDbUrl() in /var/www/drupal-8/modules/contrib/migrate_upgrade/src/MigrateUpgradeDrushRunner.php, line
131

Additionnal debug infos:

Drush bootstrap phase : bootstrap_drupal_database() [0.18 sec, 8.59 MB]                                                                                          [bootstrap]
Successfully connected to the Drupal database. [0.18 sec, 8.59 MB]                                                                                               [bootstrap]
Find command files for phase 4 (max=5) [0.18 sec, 8.59 MB]                                                                                                           [debug]
Drush bootstrap phase : bootstrap_drupal_full() [0.19 sec, 8.59 MB]                                                                                              [bootstrap]
About to bootstrap the Drupal 8 Kernel. [0.19 sec, 8.59 MB]                                                                                                          [debug]
Finished bootstraping the Drupal 8 Kernel. [0.24 sec, 17.14 Mo]                                                                                                      [debug]
Cache HIT cid: 8.1.16-install_profile-6dfce66ee85e248453041340113581eb [0.27 sec, 18.11 Mo]                                                                          [debug]
Find command files for phase 5 (max=5) [0.27 sec, 18.21 Mo]                                                                                                          [debug]
Cache HIT cid: 8.1.16-install_profile-6dfce66ee85e248453041340113581eb [0.27 sec, 18.22 Mo]                                                                          [debug]
Cache HIT cid: 8.1.16-commandfiles-5-92e6238332978e1955a818fdda414315 [0.28 sec, 18.6 Mo]                                                                            [debug]
Bootstrap to phase 6. [0.48 sec, 21.64 Mo]                                                                                                                       [bootstrap]
Drush bootstrap phase : bootstrap_drupal_login() [0.48 sec, 21.64 Mo]                                                                                            [bootstrap]
Find command files for phase 6 (max=6) [0.5 sec, 22.06 Mo]                                                                                                           [debug]
Found command: migrate-upgrade (commandfile=migrate_upgrade) [0.5 sec, 22.06 Mo]                                                                                 [bootstrap]
Calling hook drush_migrate_upgrade [0.57 sec, 25.11 Mo]                                                                                                              [debug]
Undefined index: legacy-db-key MigrateUpgradeDrushRunner.php:119 [0.57 sec, 25.23 Mo]                                                                               [notice]
PHP Fatal error:  Call to undefined method DrushSqlSqlBase::dbSpecFromDbUrl() in /var/www/drupal-8/modules/contrib/migrate_upgrade/src/MigrateUpgradeDrushRunner.php on line 131
Drush command terminated abnormally due to an unrecoverable error.                                                                                               [error]
Error: Call to undefined method DrushSqlSqlBase::dbSpecFromDbUrl() in /var/www/drupal-8/modules/contrib/migrate_upgrade/src/MigrateUpgradeDrushRunner.php, line
131 [0.57 sec, 25.23 Mo]

If I try to connect to a local D6DB, it works. So what is missing in my command ? is it a drush limitation ?

Thanks

Magento 1 to Magento 2 Migration error

For Migration I ran below 2 commands.

php bin/magento migrate:settings -r -a vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.3.8/config.xml

php bin/magento migrate:data -r -a vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.3.8/config.xml

Then I got below error

[2018-11-15 06:58:27][WARNING]: Source fields are not mapped. Document: customer_eav_attribute. Fields: is_used_for_customer_segment

Then I placed below code in map.xml first, then in map-eav.xml finally in map-customer.xml.

   customer_eav_attribute.is_used_for_customer_segment

But I am still getting the previous error.

Disable chat migration notification if one of the users has insufficient rep?

Simple request, really.

Can we add a detection for the

Please avoid extended discussions in
comments. Would you like to
automatically move this discussion to
chat?

prompt, so that if one of the users in the “extended discussion” has under 20 rep it doesn’t appear? I think a lot of the users this apply to will have low rep and it may take some back and forth to get good info out of them.

New suggestion: how about if a sufficiently high-rep user is clicking on the link, the low-rep user gets a field promotion sufficient to chat? Low-rep users are particularly prone to post questions to lead in this direction of needing to move to chat.

Data Migration: Unload/load of GENERATED ALWAYS TIMESTAMP

we are in the process of migrating data from CFM2003 to FCI103.
We need to retain the TIMESTAMP of the migrating data in the target table.

CFFOLIO.FOLIO

During the data migration we have a ‘TIMESTAMP’ based attribute in the target tables. Were the constraint is like below highlighted.

CREATE TABLE "CFFOLIO"."FOLIO" (
"FOLIO_ID" BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY ( START WITH 1 INCREMENT BY 1 MINVALUE -9223372036854775808 MAXVALUE 9223372036854775807 NO CYCLE CACHE 20 NO ORDER ),
"FOLIO_STATE_ID" BIGINT NOT NULL,
"TIMESTAMP" TIMESTAMP NOT NULL GENERATED ALWAYS FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP,
"ASSIGNEE" VARCHAR(50 OCTETS),
"LOCKED_BY" VARCHAR(50 OCTETS),
"LOCKED_TIMESTAMP" TIMESTAMP,
"FOLIO_PRIORITY_TYPE_ID" BIGINT NOT NULL,
"CONTEXT_ID" BIGINT NOT NULL,
"NAME" VARCHAR(100 OCTETS),
"DESCRIPTION" VARCHAR(2000 OCTETS),
"FOLIO_KEY" VARCHAR(50 OCTETS),
"SCORE" DECIMAL(6 , 2) NOT NULL,
"FRAUD_ASSESSMENT_VALUE_ID" BIGINT,
"DUE_TIMESTAMP" TIMESTAMP,
"INBASKET_ID" BIGINT NOT NULL,
"TZ_OFFSET" BIGINT,
"IS_CONFIDENTIAL" INTEGER NOT NULL DEFAULT 0
) 

the data being migrated already has the TIMESTAMP and that need to be retained in the target table.

In order to retain the TIMESTAMP of existing data,
we had to remove the constraint first — ALTER TABLE CFFOLIO.FOLIO ALTER COLUMN TIMESTAMP DROP GENERATED;
load the data — used a java program to load the values from CSV files
put the constraint back –? we have a challenge here
we are able to do step 1 and 2. But struggling to find the correct syntax to put the constraint back.
Looking at the forum link, i see you were i similar situation and wanted to know if you have figured a way out or the correct the syntax
upon some try and search, we could find some clues (below).

SET INTEGRITY FOR CFFOLIO.FOLIO OFF; 
 ALTER TABLE CFFOLIO.FOLIO ALTER COLUMN TIMESTAMP SET GENERATED ALWAYS AS (FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP); 
SET INTEGRITY FOR CFFOLIO.FOLIO IMMEDIATE CHECKED FORCE GENERATED; 
        ALTER TABLE sql above in RED, gives a syntax error.

Request for help in finding correct syntax or if there is any other way to do this.

Thanks & Regards
Raja Pinja