data-migration

Updating 4 million records in SQL server using list of record-ids as input

霸气de小男生 提交于 2019-12-10 13:18:39
问题 During a migration project, I'm faced with an update of 4 millions records in our SQL Server. The update is very simple ; a boolean field needs to be set to true/1 and the input I have is a list of all the id's for which this field must be filled.(one id per line) I'm not exactly an expert when it comes to sql tasks of this size, so I started out trying 1 UPDATE statement containing a " WHERE xxx IN ( {list of ids, separated by comma} ) ". First, I tried this with a million records. On a

Migration of solr cores after solr version upgradation from 4.10.4 to 6.6.0 on Cent os 7

走远了吗. 提交于 2019-12-10 12:17:16
问题 I have upgraded apache solr from 4.10.4 to 6.6.0 on Cent os 7 server, with the help of Upgrade Apache Solr from 4.10.4 to 6.6.0 on Cent os 7 I have taken backup of old solr core namely sample_core in /home/user/old_solr/sample_core folder How can I migrate my old solr(4.10.4) data in new solr version (6.6.0) 回答1: Make sure solr is running sudo service solr status Create new solr core by name sample_core use solr user sudo su solr Create sample_core /opt/solr-6.6.0/bin/solr create -c sample

How to include custom data migrations and static/reference data in an SSDT project?

我们两清 提交于 2019-12-10 02:56:40
问题 We have a moderately-sized SSDT project (~100 tables) that's deployed to dozens of different database instances. As part of our build process we generate a .dacpac file and then when we're ready to upgrade a database we generate a publish script and run it against the database. Some db instances are upgraded at different times so it's important that we have a structured process for these upgrades and versioning. Most of the generated migration script is dropping and (re)creating procs,

How to make field enum migration yii2

独自空忆成欢 提交于 2019-12-10 01:00:46
问题 I make field ENUM and the result is error when I use yii migrate/up on CMD windows. public function up() { $tableOptions = null; if ($this->db->driverName === 'mysql') { $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; } $this->createTable('{{%user_social_media}}', [ 'social_media' => $this->ENUM('facebook', 'google', 'twitter', 'github'), 'id' => $this->primaryKey(), 'username' => $this->string(), 'user_id' => $this->integer(11), 'created_at' => $this->integer(11),

How to add a new code-first migration with a newly-generated database?

痴心易碎 提交于 2019-12-09 07:11:40
问题 I've enabled code-first migrations on my entity framework project, and have added several migrations which do things like rename tables. However, I have now deleted the database and caused entity framework to generate a brand new database based on my latest data model. If I try to run: PM> Add-Migration TestMigration ... it tells me that I need to apply the existing migrations first. So I run: PM> Update-Database ... but the trouble is that it's trying to update a database that doesn't need

Select & Insert across multiple databases with MySQL

泄露秘密 提交于 2019-12-09 05:10:46
问题 I have 2 identical tables in 2 different databases that reside on the same server. What would be the best way to copy data from table to another? 回答1: Use: INSERT INTO db1.table1 SELECT * FROM db2.table2 t2 WHERE NOT EXISTS(SELECT NULL FROM db1.table1 t1 WHERE t1.col = t2.col) The exists is simplified, but you left out if there's a primary key/auto_increment to worry about/etc. 回答2: Just to elaborate slightly on OMG Ponies' answer, you can use any WHERE clause, like so: INSERT INTO db1

Restore users in SVN after migration

爱⌒轻易说出口 提交于 2019-12-08 21:22:39
How can I restore the user accounts after restoring the dump file, so that the repository starts functioning with the former user accounts and access rules? According to Version Control with Subversion : The Subversion repository dump format describes versioned repository changes only. It will not carry any information about uncommitted transactions, user locks on filesystem paths, repository or server configuration customizations (including hook scripts), and so on. However, if you still have access to the old repository you may try copying the contents of conf subdirectory to the new

In Django/South HOWTO create an instance of a model from a different app during DataMigration

陌路散爱 提交于 2019-12-08 19:51:17
问题 I need to perform a datamigration of a model Answer in app Question . In that script there is a dependency such that I need to create an instance of a model Chapter which is in the app Journal . So, I coded it as follows: def forwards(self, orm): for answer_object in orm.Answer.objects.all(): #This Works. blog, is_created = orm['blog.Post'].objects.get_or_create(title=answer_object.answer[:100]) blog.save() #This DOES NOT work chapter, is_created = orm['journal.Chapter'].objects.get_or_create

Counting non-empty values in each column of a table

醉酒当歌 提交于 2019-12-08 12:41:20
问题 I am looking for missing data in a data migration project, and this report will help me immensely. Given a MySQL table, I would like to count all the empty (NULL or '') values in each row of that table. The output would be a list of column names and a count of empty or non-empty rows for each column. This data is something I would manually compare to the source tables - manually because I expect few counts to match up exactly and column names are completely different between the source and

Restore users in SVN after migration

混江龙づ霸主 提交于 2019-12-08 07:26:53
问题 How can I restore the user accounts after restoring the dump file, so that the repository starts functioning with the former user accounts and access rules? 回答1: According to Version Control with Subversion: The Subversion repository dump format describes versioned repository changes only. It will not carry any information about uncommitted transactions, user locks on filesystem paths, repository or server configuration customizations (including hook scripts), and so on. However, if you still