pstream is dead; long live pstream
taciturnaxolotl.github.io/pstream-ng/
1---
2title: 'Update guide'
3---
4
5# Keeping your instance synced
6
7Keeping your instance up-to-date with the latest features and bug fixes can enhance your instance's functionality and ensure it stays current. When updates are released, you have the option to adopt them using either one of the guides. Below is a automatic and an manual guide on updating your instance.
8
9## Automatic update
10
11You can also setup a scheduled workflow to automatically update your instance. This will allow you to keep your instance up to date without manual intervention.
12
13To do this, you will need to follow the guide below...
14
15<Warning>
16 This upgrade method will only work if your repository is a fork!
17</Warning>
18
19<Steps>
20 <Steps.Step>
21 If you have not already, click [here](https://github.com/p-stream/p-stream/fork) to fork the P-Stream Github repository.
22 </Steps.Step>
23 <Steps.Step>
24 Paste the below file into your repository's root `/.github/workflows` directory
25
26 ```yaml
27 # File: .github/workflows/sync.yml
28 name: Sync fork
29
30 permissions:
31 contents: write
32
33 on:
34 schedule:
35 - cron: "0 0 * * *"
36 workflow_dispatch:
37
38 jobs:
39 sync:
40 name: Sync fork
41 runs-on: ubuntu-latest
42 if: ${{ github.event.repository.fork }}
43
44 steps:
45 - name: Checkout code
46 uses: actions/checkout@v4
47
48 - name: Sync fork
49 run: gh repo sync ${{ github.repository }}
50 env:
51 GH_TOKEN: ${{ github.token }}
52
53 - uses: gautamkrishnar/keepalive-workflow@v1
54 ```
55
56 </Steps.Step>
57 <Steps.Step>
58 Commit and push the changes to your repository.
59 </Steps.Step>
60</Steps>
61
62Your instance should now be automatically updated to the latest version.
63
64## Manual update
65
66You can manually update by executing the following commands in the root directory of the repository you have created, you would have to do this every time a push occurs to stay up-to-date:
67
68```bash
69git remote add P-Stream https://github.com/p-stream/p-stream.git
70git fetch P-Stream
71# Change `dev` to `master` if you want a stable experience
72git merge P-Stream/dev --allow-unrelated-histories
73git push -f # Force push to your origin main branch
74```
75
76# Upgrade version
77
78## From `3.X` to `4.X`
79
80You will need the latest version of the proxy worker. Redeploy a new worker using [our self-hosting guide](../proxy/deploy.md).
81
82After you have the new worker, you will need to [get the new P-Stream deployment files](https://github.com/p-stream/p-stream/releases/latest). **You CANNOT use the non-PWA version**. To upgrade safely without any complications, you need to update with `P-Stream.pwa.zip`, Not the non-PWA version.
83
84In the future, you will **ALWAYS** need to go with the PWA option. You cannot downgrade to non-PWA version without facing many caching complications.