You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2. For the remaining prompts from the `lb4 datasource` command, use the defaults
35
+
(press Enter for each one) since these will be replaced in the next step:
36
+
37
+
```
38
+
? Select the connector for mysqlDs: In-memory db (supported by StrongLoop)
39
+
? window.localStorage key to use for persistence (browser only):
40
+
? Full path to file for persistence (server only):
41
+
```
42
+
43
+
3. Replace the contents of the newly created
44
+
`src/datasources/{dataSource.dataSourceName}.datasource.config.json` file in
45
+
your LoopBack 4 application with the datasource configuration from
46
+
`server/datasources.json` in your LoopBack 3 application.
47
+
48
+
{% include code-caption.html content="server/datasources.json" %}
49
+
50
+
```json
51
+
{
52
+
"mysqlDs": {
53
+
"name": "mysqlDs",
54
+
"connector": "mysql",
55
+
"host": "demo.strongloop.com",
56
+
"port": 3306,
57
+
"database": "getting_started",
58
+
"username": "demo",
59
+
"password": "L00pBack"
60
+
}
61
+
}
62
+
```
63
+
64
+
{% include code-caption.html content="src/datasources/mysql-ds.datasource.config.json" %}
65
+
66
+
```json
67
+
{
68
+
"name": "mysqlDs",
69
+
"connector": "mysql",
70
+
"host": "demo.strongloop.com",
71
+
"port": 3306,
72
+
"database": "getting_started",
73
+
"username": "demo",
74
+
"password": "L00pBack"
75
+
}
76
+
```
77
+
78
+
4. Repeat steps 1-3 for each datasource you want to migrate.
79
+
80
+
{% include note.html content="We are working on a CLI command `lb4 import-lb3-datasources` that will migrate datasources from a mounted LoopBack 3 application to a LoopBack 4 project automatically. See [GitHub issue #4346](https://github.com/strongloop/loopback-next/issues/4346) for more details." %}
81
+
82
+
## Compatibility
83
+
84
+
As mentioned before, LoopBack 3 datasources are compatible with LoopBack 4
85
+
datasources. In both, a datasource is a connector instance that is used by
86
+
`legacy-juggler-bridge`. For example, both a LoopBack 3 MySQL datasource and a
0 commit comments