![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
layer-migrate
Advanced tools
A command line tool for exporting your chat data from Layer and importing it to Stream
Layer's API is shutting down October 30th leaving many customers in a difficult position. This guide shows you how to export your data from Layer and safely migrate to Stream.
This is a work in progress. The automatic import functionality on Stream's side is tested by many customers. We are still working to make it easier to export data from Layer. Following the steps in this repo will be easier in a few days.
Install the layer-migrate tool
$ yarn global add layer-migrate
A. You need to generate a key to sign your layer export with:
$ mkdir keys
$ openssl genrsa -out keys/layer-export.pem 2048 && openssl rsa -in keys/layer-export.pem -pubout -out keys/layer-export.pub
B. As a second step you'll want to lookup your application ID and the Server API token from your Layer Dashboard.
$ export LAYER_APP_ID=YOUR_APP_ID_HERE (looks like 1dab157e-4d19-11e6-bb33-493b0000asdfasba)
$ export LAYER_TOKEN=YOUR_TOKEN_HERE (2vsm4yLCG24Y44IfSK6w8nBIxAgrVcU20zuPJ3fO8eXXv5Ub)
You can find your application ID under the Keys
section of your Layer dashboard.
And you can find your Layer token under Server API
.
Note: You must create the server API token. It will not be automatically generated for you.
C. Register your new key
$ layer-migrate register-key
D. Start an export
$ layer-migrate export
A. Wait for the export to complete
$ layer-migrate status
Note that Layer will also send you an email when the download completes
B. Download the export
Once the export is completed the JSON will include a download_url. You can download the file with the following command:
$ wget -O download.tar.gz.enc DOWNLOAD_URL
C. Decrypt the export
https://docs.layer.com/reference/server_api/data.out#decrypting-export-archives
# path to the file you just downloaded
$ export ENCRYPTED_TARBALL=download.tar.gz.enc
# path for the unencrypted tar
$ export OUTPUT_TAR=export.tar.gz
# path to the private key
$ export PRIVATE_KEY_PATH=keys/layer-export-key.pem
# the encrypted_aes_key from the export json
$ export ENCRYPTED_AES_KEY=V5sWiwjTVEur3/YfHvAsqj2tIBAcw5Q0pVnwQT1A03SwrD5PpQKZv9IlN1wFncVmuk+UWM2ZEJXbDUJRrHZktFvG9TTDL4M39HoFDqQNUD2g6Sof6JMmTAmoohHrVBiKDMxHXftuN+K/xnk0XR6xytPGd44R9NLuOVnOSgYldqQzCGHXIutUSfrbji+SWL3bPOJ72PMWolxoB8kVnFzwaiKn8spMzetw5yOsilwcijQy8PqUsDMz6ExKYvTB7N1tKmUccfSQoLG4jRqTlrgVGWpwp/a/kRDN5gsbGasZqi3zRP0tzcSOpAPH2mjfAc6gbrCLkaWPdtzVw3LWDo6HOQ==
# the aes_iv key from the export json
$ export AES_IV=dcmxMx47CNS6R5d8VcMISA==
$ openssl enc -in $ENCRYPTED_TARBALL -out $OUTPUT_TAR -d -aes-256-cbc -K `echo $ENCRYPTED_AES_KEY | base64 --decode | openssl rsautl -decrypt -inkey $PRIVATE_KEY_PATH | hexdump -ve '1/1 "%.2x"'` -iv `echo $AES_IV | base64 --decode | hexdump -ve '1/1 "%.2x"'`
Head over to https://getstream.io/chat and click on the "Sign Up" button.
Next, go to https://getstream.io/dashboard and click on the created application (or create a new application should you need to). Then, click on the "Chat" button at the top of the dashboard.
Under the application, you can find your Stream App Key as well as your Stream App Secret. Both are needed in order to start the live migration from Layer to Stream Chat.
Simply email support@getstream.io with your data export. It typically takes 1 business day to import the data; however, smaller data exports will take less time.
Note: Depending on your security preferences you can either send us the decrypted file, or the encrypted version with the key to decode it.
You can start syncing writes from Stream to Layer via webhooks. This is especially useful if you have mobile clients where it takes a while to update.
We are currently working on a generic Stream webhook that you can use to sync layer to Stream. This is still a work in progress.
Have a look at the serverless folder. It includes a functional example webhook of how you can sync layer to Stream.
You can set the webhook using this command:
<<<<<<< HEAD
layer-migrate webhook --url yourwebhookurl --secret yourwebhooksecret
=======
```bash
$ layer-migrate webhook --url YOUR_WEBHOOK_URL
>>>>>>> f21f9e463a307510a4c0cc4947e4a033f2462487
For the webhook secret you can use any random string. You just need to be sure to use the same secret when validating the webhook signature.
You can test the webhook like this.
$ layer-migrate test-webhook
<<<<<<< HEAD The NGROK tool will come in handy as well.
=======
f21f9e463a307510a4c0cc4947e4a033f2462487
The stream support team will send you a fully functional react example for testing your imported data. You'll want to review these 4 tutorials to learn more about how Stream works:
Implement the UI that you want for your chat, and flip the switch. Customizing Stream's libraries is typically easier than starting from scratch.
FAQs
A command line tool for exporting your chat data from Layer and importing it to Stream
The npm package layer-migrate receives a total of 0 weekly downloads. As such, layer-migrate popularity was classified as not popular.
We found that layer-migrate demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.