Back

VPS error hit me last night, I can backup the containers but I am unsure how to do so..

  • 1
  • Self Hosted
DevDylan.zip
11 Mar, 2023, 15:03

can't find anything on attempts to handle DB storage transfers

TL;DR
The user encountered an error while updating card art URLs on their VPS. They attempted to restore from a backup but are unsure how to do so. They suspect it may be a bug and mentioned the specific error they received. The user shared code snippets showing the update process. They mentioned exhaustion and lack of sleep. Another user suggested watching a YouTube video on backing up and restoring servers. There is no solution mentioned in the thread.
DevDylan.zip
11 Mar, 2023, 15:03

if anyone replies please @ me

Drake
11 Mar, 2023, 16:14

Sorry to hear about your VPS disaster 😕

I would backup from the old server and restore to the new:

https://www.youtube.com/watch?v=lM5yZEPtlvg&ab_channel=Appwrite

DevDylan.zip
11 Mar, 2023, 17:45

thank you, still at it, going to check this out now

DevDylan.zip
12 Mar, 2023, 02:13

so, I managed to salvage everything but there is this really odd thing going on

DevDylan.zip
12 Mar, 2023, 02:14
TypeScript
    def updateCardArtURLAttributes(self, collectionID):# payload will have the documentID
      url = self.ENDPOINT + "/databases/" + self.DATABASE_ID + "/collections/" + collectionID + "/documents?queries[0]=limit(100)"
      self.log.info(url)
      jsonResponse = requests.request("GET", url, headers={'X-Appwrite-Project': str(self.PROJECT)} , data = {}).json()
      self.log.info("\n jsonResponse : \n" + str(jsonResponse) + "\n \n \n")
      cardArtURLList = []
      totalDocuments = int(jsonResponse['total'])      
      if totalDocuments >= 100:
        totalDocuments = 100
      for index in range(0,totalDocuments - 1):
        print(index)
        databases = Databases(self.CLIENT)
        documentID = str(jsonResponse['documents'][index]['$id'])
        cardName = str(jsonResponse['documents'][index]['cardName'])
        cardArtFileSaveName = str(jsonResponse['documents'][index]['cardName']).replace(" ", "-") +'.png'
        cardArtURL = str(self.HOST_URL) + "/cardArt/" + str(cardArtFileSaveName)
        # self.log.info("updating " + str(jsonResponse['documents'][index]['cardName']) + "'s cardArt URL to : " + cardArtURL + " \n ")
        # print(str(self.DATABASE_ID) + ' ' + str(collectionID) + ' ' + str(documentID)) 
        print(str(jsonResponse['documents'][index]))    
DevDylan.zip
12 Mar, 2023, 02:14
TypeScript
      
        self.log.info(str(self.DATABASE_ID) + ' ' + str(collectionID) + ' ' + str(documentID))
        cardArtURLList.append({ "documentID" : str(documentID), "cardName" : str(cardName), "cardArt" : str(cardArtURL) })
        try:
          data ={ "cardURL" : str(cardArtURL) } 
          print(data)
          result = databases.update_document( self.DATABASE_ID, collectionID, documentID, data ={ "cardArt" : str(cardArtURL) } )
        except Exception as e:
          self.log.error("\n================================================\nerror while attempting to update cardArt links \nIOError :\n" + str(e) )
          print("\n================================================\nerror while attempting to update cardArt links \nIOError :\n" + str(e) )
      return cardArtURLList
DevDylan.zip
12 Mar, 2023, 02:14

honestly, I am exhausted

DevDylan.zip
12 Mar, 2023, 02:15

have not slept for about 2 days and have been on this after being awake long enough to not be tired again, about to call it here but I think I should mention what is going on

DevDylan.zip
12 Mar, 2023, 02:15

as it is strange

DevDylan.zip
12 Mar, 2023, 02:15

the above didn't have any issues until the importing of the backed up DB data

DevDylan.zip
12 Mar, 2023, 02:15

there are two services that engage this method

DevDylan.zip
12 Mar, 2023, 02:16

they both have the same attributes and schema

DevDylan.zip
12 Mar, 2023, 02:16

and the payloads, everything comes out the same

DevDylan.zip
12 Mar, 2023, 02:16

but for some reason one of the two was throwing this error

DevDylan.zip
12 Mar, 2023, 02:17

I haver to update the card art urls because the endpoint they were using has changed as I have changed servers

DevDylan.zip
12 Mar, 2023, 02:17

at first the prompt said that there was no "cardArt" attribute, and there is and should be... but it was so odd I decided to remove it

DevDylan.zip
12 Mar, 2023, 02:18

and now I am receiving the same error but for the next top line item in the schema

DevDylan.zip
12 Mar, 2023, 02:18

but I am doing a update

DevDylan.zip
12 Mar, 2023, 02:18

and my payload doesn't have anything other than the contents needing to be updated

DevDylan.zip
12 Mar, 2023, 02:18

I think this might actually be a bug

DevDylan.zip
12 Mar, 2023, 02:18

I am going to update as I see a prompt

DevDylan.zip
12 Mar, 2023, 02:18

but wanted to give the feedback

Drake
12 Mar, 2023, 03:24

What error?

Drake
12 Mar, 2023, 03:25

How exactly did you restore?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more