The thing that was removed was the Codea version of the restore. You can still do the export, but only assets can be restored. The functions are still valid. Since you’re listed as a beta tester, you probably have the latest beta version of Codea. So here’s a copy of my backup/restore that uses the new functions. There are 4 sliders that need to be turned on depending on what you want to do. Allow_bkup_create needs to be on to create a backup file. Allow_project_extract needs to be on to extract a file. Only_view_project_extract needs to be on if you just want to see the extracted project printed in the print panel. Allow_overwrite needs to be on if you want to overwrite an existing project. To use the code, turn on the Allow bkup create slider and tap Create a backup file. To restore a project, tap Select a backup file and tap the backup file you want to use and then tap List all projects. Tap the project you want to extract, and tap Extract or view a project. If the project already exists, turn on Allow overwrite and tap Extract again. You can create as many backup files as you want because the backup file name is the date and time of the backup.
EDIT: THIS PROJECT IS ONLY FOR THE BETA VERSION OF CODEA. ONCE THE BETA IS LIVE, THEN THIS CAN BE USED.
function setup()
proj=listProjects("documents")
param()
pns="PROJ".."NAME".."START" -- project name start
pne="PROJ".."NAME".."END" -- project name end
tns="TAB".."NAME".."START" -- tab name start
tne="TAB".."NAME".."END" -- tab name end
te="TAB".."END" -- tab end
pe="PROJ".."END" -- project end
end
function param()
pasteboard.text=""
parameter.clear()
parameter.boolean("Allow_bkup_create",false)
parameter.boolean("Allow_project_extract",false)
parameter.boolean("Only_view_project_extract",false)
parameter.boolean("Allow_overwrite",false)
parameter.action("Create a backup file.",createBkup)
parameter.action("Select a backup file.",selectProject)
parameter.action("List all projects.",showProjects)
parameter.action("Extract or view a project.",extractProject)
end
function createBkup()
output.clear()
if not Allow_bkup_create then
print("Allow_bkup_create not on.")
return
end
local t=os.date("*t")
backupName=string.format("bkup%02d%02d-%02d%02d",t.month,t.day,t.hour,t.min)
local temp={}
local dt=os.date()
local cnt=0
table.insert(temp,"BKUP==START.."..dt)
for a,b in pairs(proj) do
print(b)
lst=listProjectTabs(b)
cnt=cnt+1
table.insert(temp,pns.."=="..b.."=="..pne)
for c,d in pairs(lst) do
table.insert(temp,tns.."=="..d.."=="..tne)
table.insert(temp,readProjectTab(b..":"..d))
table.insert(temp,"=="..te)
end
table.insert(temp,"=="..pe)
end
table.insert(temp,"BKUP==END")
local str=table.concat(temp,"\
")
print("Backup file created.")
print(dt)
print(cnt.." Projects.")
print("File size "..#str.." bytes.")
saveText("Dropbox:"..backupName,str)
param()
end
function selectProject()
output.clear()
local lst=assetList("Dropbox")
for a,b in pairs(lst) do
if string.find(b,"bkup") then
print(b)
end
end
end
function showProjects()
output.clear()
local s=#pasteboard.text
local name=string.sub(pasteboard.text,1,s-1)
bkupFile=readText("Dropbox:"..name)
if bkupFile==nil then
print("No backup files were selected.")
return
end
local sss=pns.."==(%g+)=="..pne
for projName,proj in
string.gmatch(bkupFile,sss) do
print(projName)
end
end
function extractProject()
output.clear()
if pasteboard.text=="" then
print("A project wasn't selected.")
return
end
local s=#pasteboard.text
name=string.sub(pasteboard.text,1,s-1)
local sss=pns.."==(%g+)=="..pne.."\
(.-)=="..pe
if Only_view_project_extract then
for projName,proj in string.gmatch(bkupFile,sss) do
if name==projName then
print("=== "..name.." ===\
")
print(proj)
return
end
end
end
if not Allow_project_extract then
print("Allow_project_extract not on.")
return
end
if Allow_overwrite then
if hasProject(name) then
print("Deleting project..."..name)
deleteProject(name)
end
end
if not hasProject(name) then
print("Creating project... "..name)
createProject(name)
for projName,proj in string.gmatch(bkupFile,sss) do
if name==projName then
getTab(proj)
end
end
param()
else
print("Project "..name.." already exists.\
\
Allow_overwrite not on.")
end
end
function getTab(proj)
local sss=tns.."==(%g+)=="..tne.."\
(.-)\
=="..te
for tabName,tab in string.gmatch(proj,sss) do
saveProjectTab(name..":"..tabName,tab)
print("Tab created "..name..":"..tabName)
end
end