User Tools

Site Tools


docu:csheet:sysadm:db:my:database_migration_help

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
docu:csheet:sysadm:db:my:database_migration_help [2021/06/17 12:09]
admin created
docu:csheet:sysadm:db:my:database_migration_help [2021/06/17 13:01] (current)
admin
Line 2: Line 2:
  
 \\ \\
-If you have a full databases dump in a single file, you can get only the dump for the wanted database, by doing this commands:+If you have a **full databases dump in a single file**, you can get only the dump for the wanted database, by doing this commands:
 <code bash> <code bash>
 # search for the create database sentences and track yours (get the line number) # search for the create database sentences and track yours (get the line number)
Line 12: Line 12:
  
 \\ \\
-In case you are migrating to a database and you get this datetime default value error, do as follow to fix the value:+In case you are migrating to a database and you get this **datetime default value error**, do as follow to fix the value:
 <code bash> <code bash>
 > Invalid default value for 'Date' > Invalid default value for 'Date'
  
-sed -i 's/DEFAULT '"'"'0000-00-00 00:00:00'"'"'/DEFAULT CURRENT_TIMESTAMP/' yourapp-dump.sql+sed -i 's/datetime NOT NULL DEFAULT '"'"'0000-00-00 00:00:00'"'"'/datetime NULL DEFAULT NULL/g' yourapp-dump.sql 
 +sed -i 's/timestamp NOT NULL DEFAULT '"'"'0000-00-00 00:00:00'"'"'/timestamp NULL DEFAULT NULL/g' yourapp-dump.sql 
 +sed -i 's/'"'"'0000-00-00 00:00:00'"'"'/NULL/g' yourapp-dump.sql
 </code> </code>
docu/csheet/sysadm/db/my/database_migration_help.1623931744.txt.gz · Last modified: 2021/06/17 12:09 by admin