# CanJS 4 Migration questions

**URL:** <https://forums.bitovi.com/t/canjs-4-migration-questions/823>\
**Category:** Uncategorized\
**Created:** [March 19, 2018, 10:06am UTC](https://forums.bitovi.com/t/canjs-4-migration-questions/823 "2018-03-19T10:06:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![robfoweraker](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/robfoweraker/32/284_2.png) [@robfoweraker](https://forums.bitovi.com/u/robfoweraker)\
**Post date:** [March 19, 2018, 10:06am UTC](https://forums.bitovi.com/t/canjs-4-migration-questions/823/1 "2018-03-19T10:06:08Z")

</div>

Hi,

I recently updated our ‘example’ application from CanJS 3 to CanJS 4. In general it went well and didn’t take very long but I have some questions.

Firstly, I had to remove can-define-backup. The current version in npm is 0.0.1. I was getting an error about an incompatibility

`Error: You can't have two versions of can-dom-data-state, check your dependencies`

I only get this error is I import can-define-backup

Secondly, I have been using the can-validate-validatejs package in the CanJS 3 version of this example application. This still works, but I see that there is now a can-define-validate-validatejs package. Should I use this package now?

Thats all for now. Thanks in advance.

Rob

---

<div class="post-metadata">

**Author:** ![justinbmeyer](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/justinbmeyer/32/179_2.png) [@justinbmeyer](https://forums.bitovi.com/u/justinbmeyer)\
**Post date:** [March 19, 2018, 12:50pm UTC](https://forums.bitovi.com/t/canjs-4-migration-questions/823/2 "2018-03-19T12:50:06Z")

</div>

Rob, can you create an issue for can-define-backup? We should be able to get a fix out soon.

---

<div class="post-metadata">

**Author:** ![phillipskevin](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/phillipskevin/32/102_2.png) [@phillipskevin](https://forums.bitovi.com/u/phillipskevin)\
**Post date:** [March 20, 2018, 4:13pm UTC](https://forums.bitovi.com/t/canjs-4-migration-questions/823/3 "2018-03-20T16:13:36Z")

</div>

@robfoweraker `can-define-backup@1.0` has been published.

The API is now mixin-based, so to use it you need to call the function on your Map:

```auto
import DefineMap from "can-define/map/map";
import defineBackup from "can-define-backup";

const recipe = new DefineMap( "Recipe", {
    title: "Pancake Mix"
} );
defineBackup(recipe);

```

The documentation will be added to [canjs.com](http://canjs.com) shortly and I will also update the migration guide with this info.

---

<div class="post-metadata">

**Author:** ![robfoweraker](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/robfoweraker/32/284_2.png) [@robfoweraker](https://forums.bitovi.com/u/robfoweraker)\
**Post date:** [March 21, 2018, 5:35pm UTC](https://forums.bitovi.com/t/canjs-4-migration-questions/823/4 "2018-03-21T17:35:59Z")

</div>

@phillipskevin Thanks! I will try it out and report back - probably next week.
