# xtrabackup datadir must be empty - options?

**URL:** <https://forums.percona.com/t/xtrabackup-datadir-must-be-empty-options/4128>\
**Category:** Percona XtraBackup\
**Created:** [March 27, 2015, 8:25am UTC](https://forums.percona.com/t/xtrabackup-datadir-must-be-empty-options/4128 "2015-03-27T08:25:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![IGGt](https://avatars.discourse-cdn.com/v4/letter/i/67e7ee/32.png) [@IGGt](https://forums.percona.com/u/IGGt)\
**Post date:** [March 27, 2015, 8:25am UTC](https://forums.percona.com/t/xtrabackup-datadir-must-be-empty-options/4128/1 "2015-03-27T08:25:23Z")

</div>

In the Documentation for XtraBackup it says that

The datadir must be empty; Percona XtraBackup innobackupex --copy-back option will not copy  
over existing files.

Is there any way round this?

My DataDir is ` directory but it still wont copy-back, giving error:

.

---

<div class="post-metadata">

**Author:** ![scott.nemes](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/scott.nemes/32/5_2.png) [@scott.nemes](https://forums.percona.com/u/scott.nemes)\
**Post date:** [March 27, 2015, 5:42pm UTC](https://forums.percona.com/t/xtrabackup-datadir-must-be-empty-options/4128/2 "2015-03-27T17:42:12Z")

</div>

Hi IGGt;

You can just manually move the files yourself. However if you leave the backups directory in the data directory, it will show up in MySQL as a defunct database (i.e. the “lost+found” you see often). In MySQL 5.6.3+ you can use the ignore-db-dir option to ignore the backups directory, but if you are running 5.5 then I’d figure out how to store your backups somewhere else preferably.

[url][MySQL :: MySQL 5.6 Reference Manual :: 5.1.6 Server Command Options](http://dev.mysql.com/doc/refman/5.6/en/server-options.html#option_mysqld_ignore-db-dir%5B/url%5D)

-Scott

---

<div class="post-metadata">

**Author:** ![IGGt](https://avatars.discourse-cdn.com/v4/letter/i/67e7ee/32.png) [@IGGt](https://forums.percona.com/u/IGGt)\
**Post date:** [March 31, 2015, 9:37am UTC](https://forums.percona.com/t/xtrabackup-datadir-must-be-empty-options/4128/3 "2015-03-31T09:37:58Z")

</div>

cheers for that. In the end I created mysql/data/ and mysql/backups/ directories which enabled me to keep them separate.
