# pt-archiver errors with unique key violation

**URL:** <https://forums.percona.com/t/pt-archiver-errors-with-unique-key-violation/2610>\
**Category:** Percona Toolkit\
**Created:** [February 13, 2013, 6:24pm UTC](https://forums.percona.com/t/pt-archiver-errors-with-unique-key-violation/2610 "2013-02-13T18:24:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jessep](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jessep/32/914_2.png) [@jessep](https://forums.percona.com/u/jessep)\
**Post date:** [February 13, 2013, 6:24pm UTC](https://forums.percona.com/t/pt-archiver-errors-with-unique-key-violation/2610/1 "2013-02-13T18:24:32Z")

</div>

I have a large table, that I need to do some schema changes to, and figured the easiest way would be to create a new table, migrate the data over, and then rename. I can stop the flow of data into it in the meantime (MySQL event) so no issue there.

Source and target table schema differ as follows:  
-Added a primary key to target (BIGINT auto\_increment, and a datetime column that is included in my partitioning function).  
-Dropped some columns that were in the source table but are not required (moved from BIGINT to INT a while ago, and need to remove the redundant columns).  
-Added one tinyint column to new table with a default value of 1

When running the following command, it errors after a few thousand rows, complaining of a UNIQUE key violation, however the key data specified only exists once in the source table.

I’ve tried manually specifying the columns to copy, which didn’t do any good.

Also tried --replace and --ignore, both give me a subset of my rows.

Both source and target tables are partitioned by TO\_DAYS()

# /root/percona-toolkit-2.1.8/bin/pt-archiver --no-check-columns --no-check-charset --limit=1000 --no-delete --progress=1000 --statistics --source h=localhost,D=mydb,t=summary\_hourly --dest h=localhost,D=mydb,t=summary\_hourly\_new --where=“1=1”

Is something about what i’m trying to do not supported by pt-archiver?

Thanks,  
Jesse
