Skip to content

using GridStoreAdapter, where should I put all users files after migration? #2797

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
yorkwang opened this issue Sep 28, 2016 · 6 comments
Closed

Comments

@yorkwang
Copy link

I just migrated database from parse to my own mongoDB.
All user's file urls are like below in the new mongoDB:
http://mangabir.com:1337/parse/files/mangabird/tfss-5654de28-3768-44de-89fc-f9741087b94f-file

Then, I have downloaded all files from parse s3 using parse-files-utils, all files are saved in ~/parse-files-utils/files/downloaded_files, and my parse server's url is http://mangabir.com:1337/parse, the problem is I don't know where should I put all user's files to, after move all files to ~/parse-server-example/parse/files/mangabird, these file links like http://mangabir.com:1337/parse/files/mangabird/tfss-5654de28-3768-44de-89fc-f9741087b94f-file are still not accessible in browser.

Here is my parse server configurations:
`var express = require('express');
var ParseServer = require('parse-server').ParseServer;
var path = require('path');

var databaseUri = process.env.DATABASE_URI || process.env.MONGODB_URI;

if (!databaseUri) {
console.log('DATABASE_URI not specified, falling back to localhost.');
}

var api = new ParseServer({
databaseURI: databaseUri || 'mongodb://localhost:27017/mangabird',
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
appId: process.env.APP_ID || 'mangabird',
masterKey: process.env.MASTER_KEY || 'mangabirdappkey', //Add your master key here. Keep it secret!
serverURL: process.env.SERVER_URL || 'http://localhost:1337/parse', // Don't forget to change to https if needed
liveQuery: {
classNames: ["Posts", "Comments"] // List of classes to support for query subscriptions
},
publicServerURL: 'http://mangabir.com:1337/parse'
// filesAdapter: {
// "module": "parse-server-fs-adapter",
// "options": {
// "filesSubDirectory": "~/parse-server-example/files/mangabird" // optional
// }
//}
});
// Client-keys like the javascript key or the .NET key are not necessary with parse-server
// If you wish you require them, you can set them as options in the initialization above:
// javascriptKey, restAPIKey, dotNetKey, clientKey

var app = express();

// Serve static assets from the /public folder
app.use('/public', express.static(path.join(__dirname, '/public')));

// Serve the Parse API on the /parse URL prefix
var mountPath = process.env.PARSE_MOUNT || '/parse';
app.use(mountPath, api);

// Parse Server plays nicely with the rest of your web routes
app.get('/', function(req, res) {
res.status(200).send('I dream of being a website. Please star the parse-server repo on GitHub!');
});

// There will be a test page available on the /test path of your server url
// Remove this before launching your app
app.get('/test', function(req, res) {
res.sendFile(path.join(__dirname, '/public/test.html'));`

I'm an iOS & Android developer, maybe it's very simple, but I still can't get it. Hope you guys can help me. Thank you!

@yorkwang
Copy link
Author

Maybe I should ask this question in a simple way: Using GridStoreAdapter, where does parse server save user's uploaded files to by default?

@yorkwang
Copy link
Author

Figure it out now. I shouldn't use GridStoreAdapter, but a filesystem adapter instead.

@bobbyrehm
Copy link

@yorkwang can you go into any detail about what you did to get this to work? I'm struggling with the same issue.

@pewh
Copy link

pewh commented Jan 18, 2017

+1 I can't get fs adapter working

@andresteves
Copy link

+1

@yorkwang
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants