Questions tagged [database-migration]
database-migration is the process of transferring data between storage types, formats, or computer systems. Also refers to migrating the database from one vendor to another, or to upgrading the version of the database software.
3,989
questions
0
votes
1
answer
27
views
Migrate large data from mongodb to another mongodb on different server
I have two cluster mongodb which running on 4 servers (2 server on each cluster). They is same about collections schema. And now I want to migrate new data from one cluster to another which existing ...
2
votes
1
answer
32
views
Laravel foreign key error 1822 when migrating and adding foreign key from pivot table
I have two tables. The first one is a pivot table (with two composite keys). I want to add a foreign key in my second table and that foreign key is based on the pivot table. When I run the migration ...
0
votes
1
answer
27
views
Data Migration from On Prem to Azure SQL (PaaS)
We have an on-prem SQL Server DB (SQL Server 2017 Comp 140) that is about 1.2 TB. We need to do a repeatable migration of just the data to an on cloud SQL (Paas). The on-prem has procedures and ...
0
votes
0
answers
24
views
DB2 to MySQL Migration (stored procedures, functions, triggers)
Is there any way or tools to migrate tables, stored procedures, views, data, functions and triggers from DB2 to MySQL?
I have tried some tools but it can only migrate tables and data.
Do I have to do ...
0
votes
1
answer
40
views
Database migration cause errors for H2 database
When i run tests the following migration file causes an
Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "ALTER TABLE ACCOUNT
ADD IS_PROVIDER_ROOT_ACCOUNT ...
0
votes
0
answers
22
views
converting data types for database migration
Is there any python inbuilt library that implicitly convert the data type of one data base to a standard sql datatype(ansi sql)
eq :
oracle data type to equivalent ansi sql datatype?
0
votes
1
answer
37
views
Laravel 9 Migration ForeginKey not created
I have some problem with the Laravel 9 migrations. After i run the "php artisan migrate" command every table created with the indexes. So everthings just fine except the foregin key. I don't ...
0
votes
1
answer
21
views
When to execute database migration?
New to database migration. Assuming I have:
A new and empty database
A new server with migration files that never being executed
Now, I start my server and new tables will be created because the ...
0
votes
1
answer
35
views
Get Connection string from DBContext for DB Migration in Azure Functions Net5.0
I have a Azure function solution which is using EF. I'm injecting the DBContext in the startup.cs class.
My project layout
Project>.Function (Startup.cs, Function classes ) - Set as startup ...
0
votes
1
answer
15
views
How do I create a Flyway migration that runs after the app boots and uses another service?
I just added a new time_zone column into a user table, now I need to populate it for all existing records.
The values are supposed to be figured out based on another column postal_code in the same ...
0
votes
1
answer
42
views
SSMA unable to convert Date/time in MS Access to Datetime in SQL Server
I'm migrating my Access backend to SQL Server using SSMA. The SSMA is throwing an error when making changes in the mappings. I have the Date/Time field in Access which needs to be DateTime in SQL to ...
0
votes
1
answer
19
views
How to VACUUM a SQLite database from within an Alembic migration?
I am using SqlAlchemy Alembic to perform DB migrations on a SQLite database. One of my migrations removes many redundant records and I would like to VACUUM the database after the deletion.
Here's how ...
0
votes
2
answers
39
views
Foreign key constraint is incorrectly formed issue in laravel migration
In my laravel appication I have two migrations.
2022_06_08_075452_create_schedule_types_table.php
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use ...
0
votes
0
answers
22
views
migrate from mysql to postgresq database with sequelize
I'm actually using sequelize and express for my backend application, I use mysql for the database but I have to migrate to postres database. Is there a simple solution to do this ?
Because I'm having ...
0
votes
0
answers
29
views
Best way to change the primary key for a table in an existing project?
I have an existing Django project with some important data in the database.
But I would like to change the primary key of the main table.
How should I do it? (I am new to Django, so any newbie advice ...
0
votes
0
answers
14
views
Do we have to implement syspolicy_purge_history job in case of azure database, as there is no msdb
I migrated from sql server to Azure db.
While migrating I found a job named syspolicy_purge_history, do I also need to implement it on Azure db?
As I found the syspolicy_purge_history job is targeting ...
0
votes
1
answer
44
views
Migrating a self referencing table using Azure Data Factory
I am trying to migrate a table which has 2 colums.
Id - Primarky key
Parent ID - Foreign key populated by the value above (Id).
(So basically the FK is in the same table)
When I migrate this, I get ...
0
votes
1
answer
32
views
How to add fields to the database correctly: through a model or migrations in Sequelize?
This is my first time making a postgre database on Sequelize, and I can't figure out the migrations. As far as I understand, you have to change the database with migrations only, and you can get data ...
1
vote
1
answer
36
views
edit column/attributes in sequelize migration
Hi I'm new to migrations in sequelize, and I'm not sure how to add field/property for attributes. So my scenario is that I have two attributes sku & barcode, but I forgot to add unique: true. Now ...
0
votes
0
answers
33
views
Mysql2::Error: All parts of a PRIMARY KEY must be NOT NULL
I am using a legacy version of rails 3.2.22 and while trying to execute my migration file, I encountered this error:
rake db:migrate
== CreateBooks: migrating =========================================...
0
votes
1
answer
22
views
How to modify migration column data type in Yii
so I've got a pipeline setup on Bitbucket, where the deployments occur. Last week we setup this migration:
public function up()
{
$this->addColumn('asset', 'running_hours','DECIMAL(...
-1
votes
0
answers
27
views
Transform dynamodb data migrating to new table
I'm looking to do a data migration from one dynamodb table to another where the new table has an updated schema from the existing one.
With this I'll need to a transformation of that data from my old ...
0
votes
1
answer
41
views
How to alter index of a column in alembic
in version: 0001, I create a table users like below:
def upgrade():
op.create_table(
'users',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('email', sa.String(...
0
votes
0
answers
38
views
Illuminate\Database\QueryException could not find driver using Devilbox and postgresql
I'm still new to dockers and trying to boot up a local laravel server using devilbox. I run the docker using this line
docker-compose up -d httpd bind php pgsql --build
I've enabled pdo_pgsql and ...
5
votes
2
answers
79
views
How to update database using Liquibase in Spring boot application?
I have the following liquibase configuration for the database in the spring boot application.
Initially, these YAML scripts were executed when the application started and the database was created, ...
0
votes
2
answers
60
views
How to alter the column in laravel?
I am using laravel and mysql database ,i want to change the column type and data what ever present inside the database can you please help me to acheive this one..
Schema::table('users', function (...
-1
votes
0
answers
19
views
Doctrine - migrations diff throws strange database type notice
I am running the command:
php bin/console doctrine:migrations:diff
And getting an error:
Unknown database type leaderboard_duration_enum requested,
Doctrine\DBAL\Platforms\PostgreSQL100Platform may ...
-1
votes
0
answers
19
views
Migration from mongodb to dynamodb
My database is stored in mongodb atlas and i am planning to migrate to dynamodb. I found two methods, one is to build an ec2 instance and install mongodb there and dump my database. Then migrate using ...
0
votes
0
answers
18
views
Migrating Oracle DB with DMS: uncommitted transactions
Trying to create a DMS Migration task to migrate from an Oracle instance into an S3 bucket. This migration should be ongoing (CDC) and use DMS Binary Reader.
Seems that uncommitted transactions are ...
0
votes
0
answers
32
views
EF CodeFirst add table update-database error "Either the parameter @objname is ambiguous or the claimed @objtype (COLUMN) is wrong." wrong? Help me
EF CodeFirst with add migration add table error.
How can ı solve EF CodeFirst add table and update-database after "Either the parameter @objname is ambiguous or the claimed @objtype (COLUMN) is ...
2
votes
0
answers
35
views
What should I be aware of when applying identical SQLAlchemy migrations (models made after the fact) on a pre-exisitng Postgres database?
I have a specific question around generation and application of migrations to a pre-existing postgres database, the models have been created in SQLAlchemy (after the original DDLs), and I intend to ...
0
votes
0
answers
32
views
inserting brokenly formatted text into PostgreSQL table despite encoding errors with \copy
I have a text field (utf8) that misbehaves a little. originally fetched it includes the character sequence \u00e2\u0080\u0099 which is basically an apostrophe in another encoding. I have decided to ...
0
votes
1
answer
27
views
Modify array before storing in postgres database using enum
I am working on ruby on rails. I sending an array parameter from frontend like ["Sunday", "Monday", "Tuesday"]. Now, I want to automatically change this array to integer ...
2
votes
2
answers
37
views
Creating a nickname from other columns by migration, laravel 8
I have a table with users, which includes fields for "first name" and "last name" and I need to create a "nick" field during migration and fill them in by creating a ...
0
votes
1
answer
18
views
How to migrate wordpress DB to crafter CMS?
I have wordpress data dumb, and I want to migrate to crafter CMS.
Don't know how to do that?
0
votes
0
answers
19
views
What approaches can I take to validate Flyway migrations on existing data during testing?
I'm using Flyway and Spring Boot to perform migrations of my database on application startup, as well as Testcontainers to test the migration scripts during integration tests. This works great for ...
0
votes
1
answer
27
views
Is it needed to stop Spring Boot application during Flyway migration?
I have Spring Boot application container deployed in k8s. And I have separate container with Flyway image. I need to make a migration in PostgreSQL DB. Do I need to stop the Spring Boot application ...
0
votes
1
answer
25
views
Heroku Django postgres migration merge: psycopg2.errors.DuplicateTable: relation already exists
This is a Heroku-specific issue with a Django project 1.11.24 running Python 3.6.5 and a Heroku postgres database.
During testing of two different branches during development, different conflicting ...
0
votes
0
answers
26
views
SSMA tool - Do we get Data Migration Report after giving "STOP" during migration process?
We are trying to migrate table from Oracle database to SQL Server using SSMA tool (SQL Server Migration Assistant). We are in the final step 'Migrate data', 99% of the tables were migrated to target ...
0
votes
0
answers
24
views
How to realize what is the datatype of a column in migration file?
I have a migration file that ALTERING a column datatype, I want to know what is the datatype of the column before ALTERING?
protected override void Up(MigrationBuilder migrationBuilder)
{
...
0
votes
0
answers
35
views
How do use Sqlcmd to migrate full databases (not just tables)?
I am working on migrating databases from a 2017 SQL server to a 2016 version. The databases I am working with are hundreds of gigabytes so I am using generate script along with sqlcmd to restore.
...
0
votes
0
answers
44
views
Entity Framework Core Migration Seed throw Duplication Error
I am working with .NET 6 and an Entity Framework 7 solution. Part of migration, I have created a Seed extension classes to insert the data. My primary keys are of type Guid that I am inserting with ...
0
votes
1
answer
40
views
Integrity constraint violation laravel 9
I am using Laravel 9 to set up my migrations but I keep getting this error Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails I have looked this up ...
-1
votes
2
answers
41
views
Foreign Key Constraint Error in Laravel Migration
I have searched numerous questions on this error and cannot seem to fix it no matter what i try.
This is my error:
Syntax error or access violation: 1072 Key column 'user_id' doesn't exist in table (...
0
votes
1
answer
83
views
SQL server database (on Microsoft azure) migration to GCP (Big query or PostgreSQL)
We have a an application whose database is on MS sql server hosted on Azure. We have been asked to look into steps to migrate it to GCP (either in Big query or PostgreSQL)
After having done some ...
0
votes
1
answer
44
views
Rails cannot run remove_index
I accidentally added indexes as so:
class AddRandomIndices < ActiveRecord::Migration[5.0]
def change
add_index :charges, :pp_charge_id
add_index :new_refunds, :pp_refund_id
add_index :...
0
votes
0
answers
23
views
Data Synchronisation in Blue Green Deployment - Cloud
In a blue green deployment environment, I'm trying to use two separate database for each environment.
In this case, How does realtime data synchronisation could be done between the two databases in ...
0
votes
0
answers
17
views
What is the best way to version control the db schema & metadata in Hasura Cloud?
We've ran into an issue where we have the db backed up, but migrations got out of sorts and as a result there are a lot of GraphQL queries in our frontend code that don't match up to the db ...
0
votes
0
answers
34
views
How do I solve MySQL ERROR: Determine number of rows to copy: too many values to unpack Failed
In trying to migrate a MSSQL database using the MySQLWorkbench Migration wizard, I get the error message MySQL ERROR: Determine number of rows to copy: too many values to unpack Failed in the DATA ...
1
vote
0
answers
31
views
Postgresql move data to new table and change column names
I am new to Postgresql or SQL in general. These databases are in DBeaver and all connections are set. We have a table in an old database that we want to better label the fields in the columns to make ...